Veronique 11 hónapja
szülő
commit
8bd35440e6
27 módosított fájl, 1144 hozzáadás és 1318 törlés
  1. 0 52
      conf/KeyCode.xml
  2. 4 283
      conf/KeyId.xml
  3. 45 103
      conf/application-yjWebOne.xml
  4. 4 0
      conf/productKey.txt
  5. 0 64
      conf/rediskeys.properties
  6. 8 44
      conf/script/1000/business/BE_DocClearScriptCache.groovy
  7. 4 52
      conf/script/1000/business/BE_ERPLogin.groovy
  8. 0 14
      conf/script/1000/commons/GroovyExtensions.groovy
  9. 12 4
      conf/script/1000/init/Init_20_HeatingApp.groovy
  10. 0 219
      conf/script/1000/sync/BE_BusinessOrder_SyncDataBase2ES.groovy
  11. 44 9
      conf/sqlroot/com/yinjie/heating/business/dao/HeatingDocDao.dql
  12. 222 0
      doc/热力商户对接接口说明.md
  13. 38 8
      yjBusiness/src/main/java/com/yinjie/heating/business/dao/HeatingDocDao.java
  14. 0 165
      yjBusiness/src/main/java/com/yinjie/heating/business/service/HeatingDocServiceImpl.java
  15. 49 0
      yjBusiness/src/main/java/com/yinjie/heating/business/service/heating/CallThirdAppServiceImpl.java
  16. 241 0
      yjBusiness/src/main/java/com/yinjie/heating/business/service/heating/HeatingDocServiceImpl.java
  17. 0 26
      yjCommon/src/main/java/com/yinjie/heating/common/api/HeatingDocService.java
  18. 25 0
      yjCommon/src/main/java/com/yinjie/heating/common/api/heating/CallThirdAppService.java
  19. 38 0
      yjCommon/src/main/java/com/yinjie/heating/common/api/heating/HeatingDocService.java
  20. 1 5
      yjCommon/src/main/java/com/yinjie/heating/common/datas/ERPModule.java
  21. 42 0
      yjCommon/src/main/java/com/yinjie/heating/common/datas/HeatingAppInvokerCode.java
  22. 1 151
      yjCommon/src/main/java/com/yinjie/heating/common/datas/RedisKeys.java
  23. 57 0
      yjCommon/src/main/java/com/yinjie/heating/common/entity/callthird/BaseRequest.java
  24. 57 0
      yjCommon/src/main/java/com/yinjie/heating/common/entity/callthird/BaseResponse.java
  25. 24 11
      yjCommon/src/main/java/com/yinjie/heating/common/entity/heating/HeatingApp.java
  26. 91 0
      yjCommon/src/main/java/com/yinjie/heating/common/entity/heating/HeatingAppInvoker.java
  27. 137 108
      yjWebCore/src/main/java/com/yinjie/heating/webcore/servlet/ThirdInvokeServlet.java

+ 0 - 52
conf/KeyCode.xml

@@ -25,56 +25,4 @@
         <CodeLength>4</CodeLength>
         <TableWhere/>
     </Item>
-
-    <Item>
-        <CodeName>tbMaterialInfoType.code</CodeName>
-        <TableName>tbMaterialInfoType</TableName>
-        <CodeFieldName>materialTypeCode</CodeFieldName>
-        <CodePrefix/>
-        <CodeYear>false</CodeYear>
-        <YearLength>4</YearLength>
-        <CodeMonth>false</CodeMonth>
-        <CodeDay>false</CodeDay>
-        <CodeLength>2</CodeLength>
-        <TableWhere/>
-    </Item>
-
-    <Item>
-        <CodeName>tbPaperInfoType.code</CodeName>
-        <TableName>tbPaperInfoType</TableName>
-        <CodeFieldName>paperTypeCode</CodeFieldName>
-        <CodePrefix/>
-        <CodeYear>false</CodeYear>
-        <YearLength>4</YearLength>
-        <CodeMonth>false</CodeMonth>
-        <CodeDay>false</CodeDay>
-        <CodeLength>4</CodeLength>
-        <TableWhere/>
-    </Item>
-
-    <Item>
-        <CodeName>deBusinessOrder.code</CodeName>
-        <TableName>v_deBusinessOrder</TableName>
-        <CodeFieldName>orderCode</CodeFieldName>
-        <CodePrefix>BS</CodePrefix>
-        <CodeYear>true</CodeYear>
-        <YearLength>4</YearLength>
-        <CodeMonth>true</CodeMonth>
-        <CodeDay>true</CodeDay>
-        <CodeLength>4</CodeLength>
-        <TableWhere/>
-    </Item>
-
-    <Item>
-        <CodeName>deOrderAfterSaleBill.code</CodeName>
-        <TableName>v_deOrderAfterSaleBill</TableName>
-        <CodeFieldName>billCode</CodeFieldName>
-        <CodePrefix>AS</CodePrefix>
-        <CodeYear>true</CodeYear>
-        <YearLength>4</YearLength>
-        <CodeMonth>true</CodeMonth>
-        <CodeDay>true</CodeDay>
-        <CodeLength>4</CodeLength>
-        <TableWhere/>
-    </Item>
 </Items>

+ 4 - 283
conf/KeyId.xml

@@ -34,16 +34,6 @@
             <IDFieldName>id</IDFieldName>
             <TableWhere/>
         </Table>
-        <Table>
-            <TableName>dnDriverInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-        <Table>
-            <TableName>dnMallClient</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
     </Item>
 
 
@@ -138,290 +128,21 @@
     </Item>
 
     <Item>
-        <IDName>tbProductInfo.id</IDName>
-        <Table>
-            <TableName>tbProduct</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbProductType.id</IDName>
-        <Table>
-            <TableName>tbProductType</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbProductParameter.id</IDName>
+        <IDName>htHeatingApp.id</IDName>
         <Table>
-            <TableName>tbProductParameter</TableName>
+            <TableName>htHeatingApp</TableName>
             <IDFieldName>id</IDFieldName>
             <TableWhere/>
         </Table>
     </Item>
 
     <Item>
-        <IDName>tbProductPagePriceInfo.id</IDName>
+        <IDName>htHeatingAppInvoker.id</IDName>
         <Table>
-            <TableName>tbProductPagePriceInfo</TableName>
+            <TableName>htHeatingAppInvoker</TableName>
             <IDFieldName>id</IDFieldName>
             <TableWhere/>
         </Table>
     </Item>
 
-    <Item>
-        <IDName>tbPartInfo.id</IDName>
-        <Table>
-            <TableName>tbPartInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPartParameter.id</IDName>
-        <Table>
-            <TableName>tbPartParameter</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPartParameterItem.id</IDName>
-        <Table>
-            <TableName>tbPartParameterItem</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPartWorkProcess.id</IDName>
-        <Table>
-            <TableName>tbPartWorkProcess</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbMaterialInfoType.id</IDName>
-        <Table>
-            <TableName>tbMaterialInfoType</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>V_tbPaperMaterialId.id</IDName>
-        <Table>
-            <TableName>v_tbpapermaterialid</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPaperBrand.id</IDName>
-        <Table>
-            <TableName>tbPaperBrand</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPaperInfoType.id</IDName>
-        <Table>
-            <TableName>tbPaperInfoType</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPaperBaseInfo.id</IDName>
-        <Table>
-            <TableName>tbPaperBaseInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPaperCutInfo.id</IDName>
-        <Table>
-            <TableName>tbPaperCutInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPaperCutSizeInfo.id</IDName>
-        <Table>
-            <TableName>tbPaperCutSizeInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPaperQuoteInfo.id</IDName>
-        <Table>
-            <TableName>tbPaperQuoteInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>V_tbPaperMaterialId.id</IDName>
-        <Table>
-            <TableName>v_tbpapermaterialid</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPlatformInfo.id</IDName>
-        <Table>
-            <TableName>tbPlatformInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbPlatformRequire.id</IDName>
-        <Table>
-            <TableName>tbPlatformRequire</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbStoreBrand.id</IDName>
-        <Table>
-            <TableName>tbStoreBrand</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbStoreInfo.id</IDName>
-        <Table>
-            <TableName>tbStoreInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbStoreInvoiceInfo.id</IDName>
-        <Table>
-            <TableName>tbStoreInvoiceInfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbStorePlatform.id</IDName>
-        <Table>
-            <TableName>tbStorePlatform</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>tbStorePlatformRequire.id</IDName>
-        <Table>
-            <TableName>tbStorePlatformRequire</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deBusinessOrder.id</IDName>
-        <Table>
-            <TableName>v_debusinessorder</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderFinances.id</IDName>
-        <Table>
-            <TableName>v_deorderfinances</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderDeliveryInfo.id</IDName>
-        <Table>
-            <TableName>v_deorderdeliveryinfo</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderDetailItem.id</IDName>
-        <Table>
-            <TableName>v_deorderdetailitem</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderAfterSaleBill.id</IDName>
-        <Table>
-            <TableName>v_deorderaftersalebill</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderRefundRequest.id</IDName>
-        <Table>
-            <TableName>v_deorderrefundrequest</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderDiscount.id</IDName>
-        <Table>
-            <TableName>v_deorderdiscount</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
-
-    <Item>
-        <IDName>deOrderRiderItems.id</IDName>
-        <Table>
-            <TableName>v_deOrderRiderItems</TableName>
-            <IDFieldName>id</IDFieldName>
-            <TableWhere/>
-        </Table>
-    </Item>
 </Items>

+ 45 - 103
conf/application-yjWebOne.xml

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<application port="52100" lib="">
+<application port="52600" lib="">
 
     <resources>
-        <group name="DELIVER_SERVICE_REMOTE">
-            <node addr="127.0.0.1" port="52101"/>
+        <group name="HEATING_SERVICE_REMOTE">
+            <node addr="127.0.0.1" port="52601"/>
         </group>
 
-        <properties load="redis.properties;workProcess.properties;sftc.properties;platform.properties">
+        <properties load="redis.properties">
             <property name="orderFileRoot" value="${APP_HOME}/orderFiles"/>
             <property name="bucketFileRoot" value="${APP_HOME}/bucketFiles"/>
             <!--注入sql脚本的目录-->
@@ -59,7 +59,7 @@
         </properties>
     </resources>
 
-    <server protocol="HTTP" host="127.0.0.1" port="52102" maxbody="5m" aliveTimeoutSeconds="0">
+    <server protocol="HTTP" host="127.0.0.1" port="52602" maxbody="5m" aliveTimeoutSeconds="0">
         <!-- 前端配置了nginx,需要配置才能获取客户端真实的IP地址 -->
         <request>
             <remoteaddr value="request.headers.X-Forwarded-For"/>
@@ -75,17 +75,7 @@
             <service value="com.yinjie.heating.webcore.rest.DocInfoRest">
                 <isUseScriptService value="true"/>
             </service>
-            <service value="com.yinjie.heating.webcore.rest.PlatformRest">
-                <isUseScriptService value="true"/>
-            </service>
-            <service value="com.yinjie.heating.webcore.rest.StoreRest">
-                <isUseScriptService value="true"/>
-            </service>
 
-            <service value="com.yinjie.heating.webcore.rest.flycat.ExpressOutRest"/>
-            <service value="com.yinjie.heating.webcore.rest.flycat.OrderRest"/>
-
-            <service value="com.yinjie.heating.webcore.rest.flycat.StoreAppRest"/>
         </services>
 
         <resource-servlet webroot="root" index="index.html">
@@ -108,17 +98,8 @@
             <service value="com.yinjie.heating.webcore.rest.DocInfoRest">
                 <isUseScriptService value="true"/>
             </service>
-            <service value="com.yinjie.heating.webcore.rest.ProductRest"/>
-            <service value="com.yinjie.heating.webcore.rest.PlatformRest"/>
-            <service value="com.yinjie.heating.webcore.rest.StoreRest"/>
-            <service value="com.yinjie.heating.webcore.rest.flycat.ExpressOutRest"/>
-            <service value="com.yinjie.heating.webcore.rest.flycat.OrderRest"/>
-
-            <websocket value="com.yinjie.heating.webcore.websocket.ERPWebSocket" name="dws" groups="DELIVER_SERVICE_REMOTE"/>
-        </rest>
 
-        <rest autoload="false" base="com.yinjie.heating.common.base.ERPStoreAppHttpServlet">
-            <service value="com.yinjie.heating.webcore.rest.flycat.StoreAppRest"/>
+            <websocket value="com.yinjie.heating.webcore.websocket.ERPWebSocket" name="dws" groups="HEATING_SERVICE_REMOTE"/>
         </rest>
 
         <servlets autoload="false">
@@ -128,190 +109,151 @@
 
             <servlet value="com.yinjie.heating.common.servlet.file.FileUploadServlet"/>
 
-            <servlet value="com.yinjie.heating.webcore.servlet.ExpressCallServlet"/>
-            <servlet value="com.yinjie.heating.webcore.servlet.OrderCallServlet"/>
+            <servlet value="com.yinjie.heating.webcore.servlet.ThirdInvokeServlet"/>
         </servlets>
     </server>
 
-    <server protocol="SNCP" host="127.0.0.1" port="52101" aliveTimeoutSeconds="0">
+    <server protocol="SNCP" host="127.0.0.1" port="52601" aliveTimeoutSeconds="0">
         <services autoload="false" includes="">
-            <service value="com.dySweetFishPlugin.sql.SqlService" groups="DELIVER_SERVICE_REMOTE"/>
-            <service value="com.dySweetFishPlugin.sql.DBService" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.dySweetFishPlugin.sql.SqlService" groups="HEATING_SERVICE_REMOTE"/>
+            <service value="com.dySweetFishPlugin.sql.DBService" groups="HEATING_SERVICE_REMOTE">
                 <!--封装rexdb数据库操作服务,maxsize缓存最大查询结果数量,expireminutes缓存超时时间,分钟单位-->
                 <maxsize value="100"/>
                 <expireminutes value="1"/>
             </service>
 
-            <service value="com.dySweetFishPlugin.redis.RedisService" groups="DELIVER_SERVICE_REMOTE"/>
-            <service value="com.dySweetFishPlugin.sql.TableIdService" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.dySweetFishPlugin.redis.RedisService" groups="HEATING_SERVICE_REMOTE"/>
+            <service value="com.dySweetFishPlugin.sql.TableIdService" groups="HEATING_SERVICE_REMOTE">
                 <tableSharding value="com.yinjie.heating.business.dao.TableIdShardingStrategy"/>
                 <!--多数据源-->
                 <dataBaseMulti value="true"/>
             </service>
 
-            <service value="com.dySweetFishPlugin.sql.dao.TunaDaoService" groups="DELIVER_SERVICE_REMOTE"/>
-            <service value="com.dySweetFishPlugin.sql.dao.TunaService" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.dySweetFishPlugin.sql.dao.TunaDaoService" groups="HEATING_SERVICE_REMOTE"/>
+            <service value="com.dySweetFishPlugin.sql.dao.TunaService" groups="HEATING_SERVICE_REMOTE">
                 <dao value="com.yinjie.heating.business.dao.LoginDao"/>
                 <dao value="com.yinjie.heating.business.dao.SystemDao"/>
                 <dao value="com.yinjie.heating.business.dao.DocDao"/>
-                <dao value="com.yinjie.heating.business.dao.StoreDao"/>
-                <dao value="com.yinjie.heating.business.dao.PlatformDao"/>
-                <dao value="com.yinjie.heating.business.dao.OrderDao"/>
+                <dao value="com.yinjie.heating.business.dao.HeatingDocDao"/>
             </service>
 
-            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJQService" groups="DELIVER_SERVICE_REMOTE"/>
-            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJobProducer" groups="DELIVER_SERVICE_REMOTE"/>
-            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJobConsumer" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJQService" groups="HEATING_SERVICE_REMOTE"/>
+            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJobProducer" groups="HEATING_SERVICE_REMOTE"/>
+            <service value="com.dySweetFishPlugin.redis.jobqueue.RedisJobConsumer" groups="HEATING_SERVICE_REMOTE">
             </service>
 
             <service value="com.yinjie.heating.common.api.NoSqlKeysService" load="rediskeys.properties;eskeys.properties"
-                     groups="DELIVER_SERVICE_REMOTE"/>
+                     groups="HEATING_SERVICE_REMOTE"/>
 
-            <service value="com.yinjie.heating.common.api.TypeTokenConvertService" groups="DELIVER_SERVICE_REMOTE"/>
+            <service value="com.yinjie.heating.common.api.TypeTokenConvertService" groups="HEATING_SERVICE_REMOTE"/>
 
-            <service value="com.dySweetFishPlugin.elasticsearch.ESClient" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.dySweetFishPlugin.elasticsearch.ESClient" groups="HEATING_SERVICE_REMOTE">
                 <clusterName value="elasticsearch"/>
                 <host value="192.168.1.243"/>
                 <port value="9300"/>
             </service>
 
-            <service value="com.yinjie.heating.common.api.ERPLockDataService" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.common.api.ERPLockDataService" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.common.api.QRCodeService" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.common.api.QRCodeService" groups="HEATING_SERVICE_REMOTE">
                 <orderRule value="ProtocolCode"/>
             </service>
 
-            <service value="com.yinjie.heating.common.tool.CodeGenerate" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.common.tool.CodeGenerate" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.common.tool.ProductTagWordFilter" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.common.tool.ProductTagWordFilter" groups="HEATING_SERVICE_REMOTE">
                 <dicFile value="productKey.txt"/>
             </service>
 
-            <service value="com.yinjie.heating.common.api.OpLogService" groups="DELIVER_SERVICE_REMOTE"/>
+            <service value="com.yinjie.heating.common.api.OpLogService" groups="HEATING_SERVICE_REMOTE"/>
 
-            <service name="dws" value="com.sweetfish.source.CacheMemorySource" groups="DELIVER_SERVICE_REMOTE">
+            <service name="dws" value="com.sweetfish.source.CacheMemorySource" groups="HEATING_SERVICE_REMOTE">
             </service>
-            <service name="dws" value="com.sweetfish.service.WebSocketNodeService" groups="DELIVER_SERVICE_REMOTE"/>
+            <service name="dws" value="com.sweetfish.service.WebSocketNodeService" groups="HEATING_SERVICE_REMOTE"/>
 
-            <service value="com.yinjie.heating.business.service.SupplierInitImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.SupplierInitImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <environment value="dev"/>
                 <clearESData value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.ERPServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.ERPServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.SysMessageServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.SysMessageServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.common.api.ERPLockDataService" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.common.api.ERPLockDataService" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.DocInfoServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.DocInfoServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <!--使用业务脚本-->
                 <isUseScriptService value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.SystemServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.SystemServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.LoginServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.LoginServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.LoginUserServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.LoginUserServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.PermissionServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.PermissionServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.RoleServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.RoleServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.ConfigServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.ConfigServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.DictServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.DictServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.MenuServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.MenuServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.DeptServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.DeptServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="false"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.StoreServiceImpl" groups="DELIVER_SERVICE_REMOTE">
-                <master value="true"/>
-                <isUseScriptService value="true"/>
-            </service>
-
-            <service value="com.yinjie.heating.business.service.PlatformServiceImpl" groups="DELIVER_SERVICE_REMOTE">
-                <master value="true"/>
-                <isUseScriptService value="true"/>
-            </service>
-
-            <service value="com.yinjie.heating.business.service.flycat.ExpressOutServiceImpl" groups="DELIVER_SERVICE_REMOTE">
-                <master value="true"/>
-                <isUseScriptService value="true"/>
-            </service>
-
-<!--            <service value="com.yinjie.heating.business.service.flycat.IncomePlatformServiceImpl" groups="DELIVER_SERVICE_REMOTE">-->
-<!--                <master value="true"/>-->
-<!--                <environment value="release"/>-->
-<!--                <isUseScriptService value="false"/>-->
-<!--            </service>-->
-
-            <service value="com.yinjie.heating.business.service.flycat.PlatformAccessTokenServiceImpl" groups="DELIVER_SERVICE_REMOTE">
-                <master value="true"/>
-                <environment value="release"/>
-                <isUseScriptService value="true"/>
-            </service>
-
-            <service value="com.yinjie.heating.business.service.flycat.OrderServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.heating.HeatingDocServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="true"/>
             </service>
 
-            <service value="com.yinjie.heating.business.service.flycat.OrderSearchServiceImpl" groups="DELIVER_SERVICE_REMOTE">
-                <master value="true"/>
-                <isUseScriptService value="true"/>
-            </service>
-
-            <service value="com.yinjie.heating.business.service.flycat.OrderStepServiceImpl" groups="DELIVER_SERVICE_REMOTE">
-                <master value="true"/>
-                <isUseScriptService value="false"/>
-            </service>
-
-            <service value="com.yinjie.heating.business.service.flycat.ExpressGeoServiceImpl" groups="DELIVER_SERVICE_REMOTE">
+            <service value="com.yinjie.heating.business.service.heating.CallThirdAppServiceImpl" groups="HEATING_SERVICE_REMOTE">
                 <master value="true"/>
                 <isUseScriptService value="true"/>
             </service>
+            
         </services>
     </server>
 </application>

+ 4 - 0
conf/productKey.txt

@@ -0,0 +1,4 @@
+铜版
+铜色
+铜版纸
+克重

+ 0 - 64
conf/rediskeys.properties

@@ -64,8 +64,6 @@ redis.erplock.data = yjheating:erplock:data
 redis.erplock.userdata = yjheating:erplock:userdata
 redis.erplock.exclusivelockpart = yjheating:erplock:exclusivelockpart
 
-#版的版心尺寸
-redis.erp.breedplatesize = yjheating:erp:breedplatesize
 
 #查询统计
 redis.erp.inquireinfo = yjheating:erp:inquireinfo
@@ -73,68 +71,6 @@ redis.erp.inquireinfo = yjheating:erp:inquireinfo
 #分厂
 redis.company.info = yjheating:erp:company:info
 
-redis.erp.product.parameter = yjheating:erp:product:parameter
-redis.erp.product.info = yjheating:erp:product:info
-redis.erp.product.detail = yjheating:erp:product:detail
-redis.erp.product.type = yjheating:erp:product:type
-redis.erp.product.pagePrice = yjheating:erp:product:pagePrice
-redis.erp.product.example.image = yjheating:erp:product:exampleImage
-redis.erp.product.room = yjheating:erp:product:room
-
-#单据打印次数
-redis.erp.itemprintcount = yjheating:print:printcount
-
-redis.erp.order.cycle.item = yjheating:erp:cycle:item:order
-
-redis.erp.print.bill.cycle.item = yjheating:erp:cycle:item:printBill
-
-
-redis.erp.develop.client = yjheating:erp:developclient
-redis.erp.develop.client.code = yjheating:erp:developclientcode
-
-#机型机台
-redis.erp.machine.type = yjheating:erp:machine:type
-redis.erp.machine.info = yjheating:erp:machine:info
-
-#数据锁定
-
-redis.erp.client.industry.info = yjheating:erp:client:industry:info
-redis.erp.client.moneybalance = yjheating:erp:client:balance:clientmoney
-redis.erp.client.clientlevel = yjheating:erp:client:clientlevel
-
-#纸张品牌
-redis.erp.paper.brand = yjheating:erp:paper:brand
-#纸张开数档案
-redis.erp.paper.cut.info = yjheating:erp:paper:cut:info
-redis.erp.paper.cut.size.info= yjheating:erp:paper:cut:size:info
-
-#平台信息档案
-redis.deliver.platforminfo = yjheating:deliver:platforminfo
-#平台需求条件档案
-redis.deliver.platformrequire = yjheating:deliver:platformrequire
-#门店品牌
-redis.deliver.storebrand = yjheating:deliver:storebrand
-#抖音上一次刷新token的时间,将废弃
-redis.douyin.lasttokendate = yjheating:douyin:lasttokendate
-#抖音当前的token,将废弃
-redis.douyin.accesstoken = yjheating:douyin:accesstoken
-
-#平台上一次刷新token的时间
-redis.platform.lasttokendate = yjheating:platform:lasttokendate
-#平台当前的token
-redis.platform.accesstoken = yjheating:platform:accesstoken
-
-redis.erp.order.shop.sequence = yjheating:erp:order:shop:sequence
-
-redis.erp.working.order = yjheating:erp:working:order
-redis.erp.working.express.sf.order = yjheating:erp:working:express:sf:order
-redis.erp.working.express.sf.store = yjheating:erp:working:express:sf:store
-
-#抖音推送消息msg_id
-redis.deliver.douyin.call.msgid = yjheating:douyin:callmsgid
-
-redis.erp.order.rider.geo = yjheating:erp:order:rider:geo
-
 redis.heating.app = yjheating:heating:app
 
 

+ 8 - 44
conf/script/1000/business/BE_DocClearScriptCache.groovy

@@ -1,20 +1,16 @@
+import com.sweetfish.service.RetResult
 import com.yinjie.heating.common.api.BusinessExecutor
 import com.yinjie.heating.common.api.DocInfoService
-import com.yinjie.heating.common.api.StoreService
 import com.yinjie.heating.common.api.SystemService
-import com.yinjie.heating.common.api.flycat.ExpressOutService
-import com.yinjie.heating.common.api.flycat.OrderSearchService
-import com.yinjie.heating.common.api.flycat.OrderService
+import com.yinjie.heating.common.api.heating.CallThirdAppService
 import com.yinjie.heating.common.datas.ERPModule
 import com.yinjie.heating.common.datas.ERPModuleEntity
 import com.yinjie.heating.common.entity.base.BusinessOperation
 import com.yinjie.heating.common.entity.base.ProcessEntityItem
-import com.sweetfish.service.RetResult
 import org.apache.logging.log4j.LogManager
 import org.apache.logging.log4j.Logger
 
 import javax.annotation.Resource
-
 /**
  * Created by jlutt on 2020-08-25
  *
@@ -32,16 +28,7 @@ class BE_DocClearScriptCache implements BusinessExecutor<ProcessEntityItem<ERPMo
     DocInfoService docInfoService
 
     @Resource
-    ExpressOutService expressOutService
-
-    @Resource
-    StoreService storeService
-
-    @Resource
-    OrderService orderService
-
-    @Resource
-    OrderSearchService orderSearchService
+    CallThirdAppService callThirdAppService
 
     @Override
     String scriptName() {
@@ -64,10 +51,8 @@ class BE_DocClearScriptCache implements BusinessExecutor<ProcessEntityItem<ERPMo
             //2024-01-26未测试这个重载能不能不重启给groovy增加扩展方法,需要测试,不过理论上没啥用,因为Init_ExpandoGroovy的脚本是用的其它groovy代码实现的,先这样吧,留着以后处理,暂时不经常修改GroovyExtensions代码算了
             systemService.reloadScriptCache(source.inputItem.code, ERPModule.SYSTEM, source.dataSourceId, source.supplierCode)
             docInfoService.reloadScriptCache(source.inputItem.code, ERPModule.SYSTEM, source.dataSourceId, source.supplierCode)
-            expressOutService.reloadScriptCache(source.inputItem.code, ERPModule.SYSTEM, source.dataSourceId, source.supplierCode)
-            storeService.reloadScriptCache(source.inputItem.code, ERPModule.SYSTEM, source.dataSourceId, source.supplierCode)
-            orderService.reloadScriptCache(source.inputItem.code, ERPModule.SYSTEM, source.dataSourceId, source.supplierCode)
-            orderSearchService.reloadScriptCache(source.inputItem.code, ERPModule.SYSTEM, source.dataSourceId, source.supplierCode)
+            callThirdAppService.reloadScriptCache(source.inputItem.code, ERPModule.CALL_THIRD, source.dataSourceId, source.supplierCode)
+
         }
         else {
             switch (erpModule) {
@@ -94,32 +79,11 @@ class BE_DocClearScriptCache implements BusinessExecutor<ProcessEntityItem<ERPMo
                         systemService.reloadScriptCache(source.getInputItem().getCode(), erpModule, source.getDataSourceId(), source.getSupplierCode())
                     }
                     break
-                case ERPModule.EXPRESS_API:
-                    if (source.getOperation() == BusinessOperation.SAVE) {
-                        expressOutService.invalidateScriptCache(source.getSupplierCode() + "-" + source.getInputItem().getCode())
-                    } else {
-                        expressOutService.reloadScriptCache(source.getInputItem().getCode(), erpModule, source.getDataSourceId(), source.getSupplierCode())
-                    }
-                    break
-                case [ERPModule.ERP_ORDER, ERPModule.ORDER_API]:
-                    if (source.getOperation() == BusinessOperation.SAVE) {
-                        orderService.invalidateScriptCache(source.getSupplierCode() + "-" + source.getInputItem().getCode())
-                    } else {
-                        orderService.reloadScriptCache(source.getInputItem().getCode(), erpModule, source.getDataSourceId(), source.getSupplierCode())
-                    }
-                    break
-                case ERPModule.ERP_ORDER_SEARCH:
-                    if (source.getOperation() == BusinessOperation.SAVE) {
-                        orderSearchService.invalidateScriptCache(source.getSupplierCode() + "-" + source.getInputItem().getCode())
-                    } else {
-                        orderSearchService.reloadScriptCache(source.getInputItem().getCode(), erpModule, source.getDataSourceId(), source.getSupplierCode())
-                    }
-                    break
-                case ERPModule.STORE_API:
+                case ERPModule.CALL_THIRD:
                     if (source.getOperation() == BusinessOperation.SAVE) {
-                        storeService.invalidateScriptCache(source.getSupplierCode() + "-" + source.getInputItem().getCode())
+                        callThirdAppService.invalidateScriptCache(source.getSupplierCode() + "-" + source.getInputItem().getCode())
                     } else {
-                        storeService.reloadScriptCache(source.getInputItem().getCode(), erpModule, source.getDataSourceId(), source.getSupplierCode())
+                        callThirdAppService.reloadScriptCache(source.getInputItem().getCode(), erpModule, source.getDataSourceId(), source.getSupplierCode())
                     }
                     break
                 case ERPModule.ADDRESSPARSER:

+ 4 - 52
conf/script/1000/business/BE_ERPLogin.groovy

@@ -1,11 +1,12 @@
-import com.yinjie.heating.common.datas.TokenUserFrom
-import com.yinjie.heating.common.entity.store.StoreInfo
 import com.dySweetFishPlugin.sql.dao.TunaService
 import com.dySweetFishPlugin.tool.crypto.EncryptUtil
 import com.sweetfish.convert.json.JsonConvert
 import com.sweetfish.service.RetResult
 import com.yinjie.heating.business.dao.LoginDao
-import com.yinjie.heating.common.api.*
+import com.yinjie.heating.common.api.BusinessExecutor
+import com.yinjie.heating.common.api.DeptService
+import com.yinjie.heating.common.api.ERPService
+import com.yinjie.heating.common.api.SysMessageService
 import com.yinjie.heating.common.datas.ERPModule
 import com.yinjie.heating.common.entity.base.DataBaseMultiItemEx
 import com.yinjie.heating.common.entity.base.ProcessEntityItem
@@ -20,7 +21,6 @@ import org.apache.logging.log4j.Logger
 import org.rex.RMap
 
 import javax.annotation.Resource
-
 /**
  * ERP系统登录脚本,随着业务复杂度提高,登录功能统一一个接口提供
  */
@@ -95,54 +95,6 @@ class BE_ERPLogin implements BusinessExecutor<ProcessEntityItem<LoginRequest>, L
                         return RetResult.<ERPTokenUser> successT().result(new ERPTokenUser(info))
                     },
                     "tokenKey"     : ssoERPTokenCommonKey
-            ],
-            "80": [
-                    "name"         : "门店后台管理系统登录",
-                    "resourceLogin": { LoginRequest loginInfo ->
-                        //不允许使用superResourcer登录,防漏洞
-                        return RetResult.<ERPTokenUser> errorT().retinfo("用户账号或密码错误,登录失败")
-                    },
-                    "login"        : { LoginRequest loginInfo, RMap mapParams, DataBaseMultiItemEx supplierItem ->
-                        mapParams.put("companyId", 0L)
-                        StoreInfo info = loginDao.storeLogin(mapParams, supplierItem.dataBaseAlias, Long.parseLong(supplierItem.shardingKey))
-
-                        if (info == null) {
-                            return RetResult.<ERPTokenUser> errorT().retinfo("用户账号或密码错误,登录失败")
-                        }
-
-                        if (info.voidFlag == 1) {
-                            return RetResult.<ERPTokenUser> errorT().retinfo("用户账号已冻结,登录失败")
-                        }
-
-                        return RetResult.<ERPTokenUser> successT().result(new ERPTokenUser(info))
-                    },
-                    "tokenKey"     : ssoStoreTokenCommonKey
-            ],
-            "81": [
-                    "name"         : "门店APP管理系统登录",
-                    "resourceLogin": { LoginRequest loginInfo ->
-                        //不允许使用superResourcer登录,防漏洞
-                        return RetResult.<ERPTokenUser> errorT().retinfo("用户账号或密码错误,登录失败")
-                    },
-                    "login"        : { LoginRequest loginInfo, RMap mapParams, DataBaseMultiItemEx supplierItem ->
-                        mapParams.put("companyId", 0L)
-                        StoreInfo info = loginDao.storeLogin(mapParams, supplierItem.dataBaseAlias, Long.parseLong(supplierItem.shardingKey))
-
-                        if (info == null) {
-                            return RetResult.<ERPTokenUser> errorT().retinfo("用户账号或密码错误,登录失败")
-                        }
-
-                        if (info.voidFlag == 1) {
-                            return RetResult.<ERPTokenUser> errorT().retinfo("用户账号已冻结,登录失败")
-                        }
-
-                        ERPTokenUser tokenUser = new ERPTokenUser(info)
-                        //这里强制改一下
-                        tokenUser.userFrom = TokenUserFrom.APP_STORE_ADMIN.value
-                        return RetResult.<ERPTokenUser> successT().result(tokenUser)
-
-                    },
-                    "tokenKey"     : ssoStoreTokenCommonKey
             ]
     ]
 

+ 0 - 14
conf/script/1000/commons/GroovyExtensions.groovy

@@ -1,7 +1,3 @@
-import com.yinjie.heating.common.entity.store.StoreInfo
-import com.yinjie.heating.common.entity.store.StorePlatform
-import org.apache.commons.lang3.StringUtils
-
 class GroovyExtensions {
 
     static void apply() {
@@ -19,15 +15,5 @@ class GroovyExtensions {
             }
         }
 
-        StoreInfo.metaClass {
-            requireItem = { String platformCode, String requireCode ->
-                def storeInfo = delegate as StoreInfo
-                StorePlatform storePlatform = storeInfo.platformList.find { StringUtils.equalsIgnoreCase(it.platformCode, platformCode) }
-                if (storePlatform == null) {
-                    return null
-                }
-                return storePlatform.requireList.find {StringUtils.equalsIgnoreCase(it.platformRequireCode, requireCode)}
-            }
-        }
     }
 }

+ 12 - 4
conf/script/1000/init/Init_20_HeatingApp.groovy

@@ -1,11 +1,9 @@
 import Ignore_ExecPageFlipper as ExecPageFlipper
 import com.yinjie.heating.business.dao.HeatingDocDao
-import com.yinjie.heating.business.dao.SystemDao
 import com.yinjie.heating.common.api.NoSqlKeysService
 import com.yinjie.heating.common.datas.RedisKeys
 import com.yinjie.heating.common.entity.heating.HeatingApp
-import com.yinjie.heating.common.entity.system.DictData
-import com.yinjie.heating.common.entity.system.DictType
+import com.yinjie.heating.common.entity.heating.HeatingAppInvoker
 import com.yinjie.heating.common.tool.ERPUtils
 import com.dySweetFishPlugin.redis.RedisService
 import com.sweetfish.convert.json.JsonConvert
@@ -19,7 +17,17 @@ static def createRunnable(RedisService redisService, NoSqlKeysService keysServic
         RMap dictTypeParams = ERPUtils.ofRMap("voidFlag", -1)
         ExecPageFlipper.execute(500, { PageFlipper p ->
 
-            List<HeatingApp> heatingApps = heatingDocDao.selectAllGasApp(dictTypeParams, dataSourceId, supplierCode, p)
+            List<HeatingApp> heatingApps = heatingDocDao.selectAllHeatingApp(dictTypeParams, dataSourceId, supplierCode, p)
+
+            List<Long> ids = heatingApps.collect { it.id }
+            RMap params = new RMap<>()
+            params.put("ids", ids)
+            List<HeatingAppInvoker> invokerList = heatingDocDao.selectAllHeatingAppInvoker(params, dataSourceId, supplierCode)
+
+            heatingApps.each {
+                it.invokerList.addAll(invokerList.findAll { x -> x.idApp == it.id })
+            }
+
             Map<String, String> heatingAppMap = heatingApps.collectEntries { [String.valueOf(it.getId()), jsonConvert.convertTo(it)] }
 
             if (!heatingAppMap.isEmpty()) {

+ 0 - 219
conf/script/1000/sync/BE_BusinessOrder_SyncDataBase2ES.groovy

@@ -1,219 +0,0 @@
-import com.yinjie.heating.common.api.BusinessExecutor
-import com.yinjie.heating.common.api.SupplierInitService
-import com.yinjie.heating.common.datas.ERPModule
-import com.yinjie.heating.common.datas.ESKeys
-import com.yinjie.heating.common.entity.base.ProcessStringItem
-import com.yinjie.heating.common.entity.order.*
-import com.dySweetFishPlugin.elasticsearch.ESClient
-import com.dySweetFishPlugin.sql.DBService
-import com.sweetfish.convert.json.JsonConvert
-import com.sweetfish.service.RetResult
-import com.sweetfish.source.PageFlipper
-import com.sweetfish.util.Utility
-import org.apache.logging.log4j.LogManager
-import org.apache.logging.log4j.Logger
-import org.elasticsearch.action.bulk.BulkRequestBuilder
-import org.elasticsearch.action.bulk.BulkResponse
-import org.elasticsearch.action.index.IndexRequestBuilder
-import org.elasticsearch.action.support.WriteRequest
-import org.elasticsearch.common.xcontent.XContentType
-
-import javax.annotation.Resource
-
-@SuppressWarnings(["unused"])
-class BE_BusinessOrder_SyncDataBase2ES implements BusinessExecutor<ProcessStringItem, ProcessStringItem> {
-
-    protected final Logger logger = LogManager.getLogger(this.getClass().getSimpleName())
-
-
-    @Resource
-    SupplierInitService supplierService
-
-    @Resource
-    ESClient esClient
-
-    @Resource
-    JsonConvert jsonConvert
-
-    @Resource
-    DBService dbService
-
-    @Override
-    String scriptName() {
-        return "外卖订单-ES同步数据库"
-    }
-
-    @Override
-    ERPModule module() {
-        return ERPModule.DATA_SYNC
-    }
-
-    @Override
-    RetResult<ProcessStringItem> execute(ProcessStringItem source) {
-        String dataSourceId = source.getDataSourceId()
-        long supplierCode = source.getSupplierCode()
-
-        esClient.checkIndexEx(supplierService.getDateYearESIndex(supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 0),
-                ESKeys.INDEX_CONFIG,
-                Utility.ofMap(ESKeys.ES_DELIVER_BUSINESS_ORDER_TYPE, "businessorder.json",
-                        ESKeys.ES_DELIVER_ORDER_DELIVERY_INFO_TYPE, "orderdeliveryinfo.json",
-                        ESKeys.ES_DELIVER_ORDER_FINANCES_TYPE, "orderfinances.json",
-                        ESKeys.ES_DELIVER_ORDER_DISCOUNT_TYPE, "orderdiscount.json",
-                        ESKeys.ES_DELIVER_ORDER_DETAIL_ITEM_TYPE, "orderdetailitem.json",
-                        ESKeys.ES_DELIVER_ORDER_AFTER_SALE_BILL_TYPE, "orderaftersalebill.json",
-                        ESKeys.ES_DELIVER_ORDER_RIDER_ITEM_TYPE, "orderrideritem.json"))
-
-        ExecPageFlipper.execute(500, { PageFlipper p ->
-            List<BusinessOrder> dbList = dbService.<BusinessOrder> getList(dataSourceId, "select * from deBusinessOrder${supplierCode}_Current", BusinessOrder.class, p)
-            if (!dbList.isEmpty()) {
-                BulkRequestBuilder bulkRequest = esClient.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
-
-                dbList.each { order ->
-                    IndexRequestBuilder esRequest = esClient.getClient()
-                            .prepareIndex(supplierService.getDateYearESIndex(source.supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 1), ESKeys.ES_DELIVER_BUSINESS_ORDER_TYPE)
-                            .setId(String.valueOf(order.id))
-                            .setSource(source.getConvert("BusinessOrder").convertTo(order), XContentType.JSON)
-                    bulkRequest.add(esRequest)
-                }
-
-                BulkResponse bulkResponse = bulkRequest.execute().actionGet()
-
-                if (bulkResponse.hasFailures()) {
-                    logger.error("索引订单:" + bulkResponse.buildFailureMessage())
-                } else {
-                    logger.info("索引订单共" + dbList.size() + "条记录")
-                }
-
-            }
-        })
-
-        ExecPageFlipper.execute(500, { PageFlipper p ->
-            List<OrderDetailItem> dbList = dbService.<OrderDetailItem> getList(dataSourceId, "select * from deOrderDetailItem${supplierCode}_Current", OrderDetailItem.class, p)
-            if (!dbList.isEmpty()) {
-                BulkRequestBuilder bulkRequest = esClient.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
-
-                dbList.each { info ->
-                    IndexRequestBuilder esRequest = esClient.getClient()
-                            .prepareIndex(supplierService.getDateYearESIndex(source.supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 1), ESKeys.ES_DELIVER_ORDER_DETAIL_ITEM_TYPE)
-                            .setParent(String.valueOf(info.idOrder))
-                            .setId(String.valueOf(info.id))
-                            .setSource(jsonConvert.convertTo(info), XContentType.JSON)
-                    bulkRequest.add(esRequest)
-                }
-
-                BulkResponse bulkResponse = bulkRequest.execute().actionGet()
-
-                if (bulkResponse.hasFailures()) {
-                    logger.error("索引订单detailItem:" + bulkResponse.buildFailureMessage())
-                } else {
-                    logger.info("索引订单共detailItem" + dbList.size() + "条记录")
-                }
-
-            }
-        })
-
-        ExecPageFlipper.execute(500, { PageFlipper p ->
-            List<OrderDeliveryInfo> dbList = dbService.<OrderDeliveryInfo> getList(dataSourceId, "select * from deOrderDeliveryInfo${supplierCode}_Current", OrderDeliveryInfo.class, p)
-            if (!dbList.isEmpty()) {
-                BulkRequestBuilder bulkRequest = esClient.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
-
-                dbList.each { info ->
-                    IndexRequestBuilder esRequest = esClient.getClient()
-                            .prepareIndex(supplierService.getDateYearESIndex(source.supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 1), ESKeys.ES_DELIVER_ORDER_DELIVERY_INFO_TYPE)
-                            .setParent(String.valueOf(info.idOrder))
-                            .setId(String.valueOf(info.id))
-                            .setSource(jsonConvert.convertTo(info), XContentType.JSON)
-                    bulkRequest.add(esRequest)
-                }
-
-                BulkResponse bulkResponse = bulkRequest.execute().actionGet()
-
-                if (bulkResponse.hasFailures()) {
-                    logger.error("索引订单DeliveryInfo:" + bulkResponse.buildFailureMessage())
-                } else {
-                    logger.info("索引订单共DeliveryInfo" + dbList.size() + "条记录")
-                }
-
-            }
-        })
-
-        ExecPageFlipper.execute(500, { PageFlipper p ->
-            List<OrderFinances> dbList = dbService.<OrderFinances> getList(dataSourceId, "select * from deOrderFinances${supplierCode}_Current", OrderFinances.class, p)
-            if (!dbList.isEmpty()) {
-                BulkRequestBuilder bulkRequest = esClient.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
-
-                dbList.each { info ->
-                    IndexRequestBuilder esRequest = esClient.getClient()
-                            .prepareIndex(supplierService.getDateYearESIndex(source.supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 1), ESKeys.ES_DELIVER_ORDER_FINANCES_TYPE)
-                            .setParent(String.valueOf(info.idOrder))
-                            .setId(String.valueOf(info.id))
-                            .setSource(jsonConvert.convertTo(info), XContentType.JSON)
-                    bulkRequest.add(esRequest)
-                }
-
-                BulkResponse bulkResponse = bulkRequest.execute().actionGet()
-
-                if (bulkResponse.hasFailures()) {
-                    logger.error("索引订单OrderFinances:" + bulkResponse.buildFailureMessage())
-                } else {
-                    logger.info("索引订单共OrderFinances" + dbList.size() + "条记录")
-                }
-
-            }
-        })
-
-        ExecPageFlipper.execute(500, { PageFlipper p ->
-            List<OrderDiscount> dbList = dbService.<OrderDiscount> getList(dataSourceId, "select * from deOrderDiscount${supplierCode}_Current", OrderDiscount.class, p)
-            if (!dbList.isEmpty()) {
-                BulkRequestBuilder bulkRequest = esClient.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
-
-                dbList.each { info ->
-                    IndexRequestBuilder esRequest = esClient.getClient()
-                            .prepareIndex(supplierService.getDateYearESIndex(source.supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 1), ESKeys.ES_DELIVER_ORDER_DISCOUNT_TYPE)
-                            .setParent(String.valueOf(info.idOrder))
-                            .setId(String.valueOf(info.id))
-                            .setSource(jsonConvert.convertTo(info), XContentType.JSON)
-                    bulkRequest.add(esRequest)
-                }
-
-                BulkResponse bulkResponse = bulkRequest.execute().actionGet()
-
-                if (bulkResponse.hasFailures()) {
-                    logger.error("索引订单OrderDiscount:" + bulkResponse.buildFailureMessage())
-                } else {
-                    logger.info("索引订单OrderDiscount共" + dbList.size() + "条记录")
-                }
-
-            }
-        })
-
-        ExecPageFlipper.execute(500, { PageFlipper p ->
-            List<OrderRiderItem> dbList = dbService.<OrderRiderItem> getList(dataSourceId, "select * from deOrderRiderItem${supplierCode}_Current", OrderRiderItem.class, p)
-            if (!dbList.isEmpty()) {
-                BulkRequestBuilder bulkRequest = esClient.getClient().prepareBulk().setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
-
-                dbList.each { info ->
-                    IndexRequestBuilder esRequest = esClient.getClient()
-                            .prepareIndex(supplierService.getDateYearESIndex(source.supplierCode, ESKeys.ES_DELIVER_BUSINESS_ORDER_INDEX, 1), ESKeys.ES_DELIVER_ORDER_RIDER_ITEM_TYPE)
-                            .setParent(String.valueOf(info.idOrder))
-                            .setId(String.valueOf(info.id))
-                            .setSource(jsonConvert.convertTo(info), XContentType.JSON)
-                    bulkRequest.add(esRequest)
-                }
-
-                BulkResponse bulkResponse = bulkRequest.execute().actionGet()
-
-                if (bulkResponse.hasFailures()) {
-                    logger.error("索引订单OrderRiderItem:" + bulkResponse.buildFailureMessage())
-                } else {
-                    logger.info("索引订单共OrderRiderItem" + dbList.size() + "条记录")
-                }
-
-            }
-        })
-
-        return RetResult.successT()
-    }
-}
-
-

+ 44 - 9
conf/sqlroot/com/yinjie/heating/business/dao/HeatingDocDao.dql

@@ -1,20 +1,20 @@
+-- [queryHeatingApp]
 select * from $table$;
 
-insert into $table$
-(id, appId, appName, appPublicKey,
+-- [addHeatingApp]
+insert into $table$ (id, appId, appName, appPublicKey,
 appPrivateKey, supplyPublicKey, status,
-verifyKind, whiteIps,
-createBy, createTime, updateBy,
-updateTime)
-values ( #{id}, #{appid}, #{appname}, #{apppublickey},
+chargeFrom, chargeUserName, verifyKind,
+whiteIps, createBy, createTime,
+createTimeLong, updateBy, updateTime,
+updateTimeLong ) values ( #{id}, #{appid}, #{appname}, #{apppublickey},
 #{appprivatekey}, #{supplypublickey}, #{status},
-#{verifykind}, #{whiteips},
-#{createby}, #{createtime}, #{updateby},
-#{updatetime} );
+#{chargefrom}, #{chargeusername}, #{verifykind},
+#{whiteips}, #{createby}, #{createtime},
+#{createtimelong}, #{updateby}, #{updatetime},
+#{updatetimelong} );
 
+-- [updateHeatingApp]
 update $table$ set
 appName = #{appname},
 appPublicKey = #{apppublickey},
@@ -26,9 +26,40 @@ updateBy = #{updateby},
 updateTime = #{updatetime}
 where appId = #{appid};
 
+-- [voidHeatingApp]
 update $table$ set
 status = #{status},
 updateBy = #{updateby},
 updateTime = #{updatetime}
 where appId = #{appid};
+
+-- [queryHeatingAppInvoker]
+select * from $table$
+-- trim prefix=WHERE prefixOverrides=AND|OR
+  -- isNotEmpty ids
+        and idApp in (/* in ids */)
+  -- end
+-- end
+;
+
+-- [addHeatingAppInvoker]
+insert into $table$ (id, appId, appName, invokerName,
+invokerCode, description, invokerUrl,
+createBy, createTime, createTimeLong,
+updateBy, updateTime, updateTimeLong ) values ( #{id}, #{appid}, #{appname}, #{invokername},
+#{invokercode}, #{description}, #{invokerurl},
+#{createby}, #{createtime}, #{createtimelong},
+#{updateby}, #{updatetime}, #{updatetimelong} );
+
+-- [updateHeatingAppInvoker]
+update $table$ set
+invokerName = #{invokername},
+invokerCode = #{invokercode},
+description = #{description},
+invokerUrl = #{invokerurl},
+updateBy = #{updateby},
+updateTime = #{updatetime}
+where id = #{id};
+
+-- [deleteHeatingAppInvoker]
+delete from $table$ where id = #{id};

+ 222 - 0
doc/热力商户对接接口说明.md

@@ -0,0 +1,222 @@
+[TOC]
+
+# 接口规则
+
+## 协议规则
+
+调用API必须遵循以下规则:
+
+| 规则   | 说明                                |
+| ---- | --------------------------------- |
+| 传输方式 | HTTP/HTTPS                        |
+| 提交方式 | 采用POST方法提交                        |
+| 数据格式 | 提交和返回数据都为JSON格式                   |
+| 字符编码 | 统一采用UTF-8字符编码                     |
+| 安全机制 | 签名或者IP白名单                         |
+| 签名算法 | 如安全机制未签名,RSA(2048)/和支付宝RAS2方式签名一样 |
+| 签名要求 | 如安全机制未签名,请求和接收数据均需要校验签名           |
+
+## 参数规则
+
+### 请求参数
+
+| 参数             | 类型         | 必填 | 描述                                  | 示例值                              |
+| -------------- | ---------- | -- | ----------------------------------- | -------------------------------- |
+| appId          | String(32) | 是  | 接口应用号                               | 123456789                        |
+| clientCode     | String(32) | 是  | 商城客户号                               | yinjie                           |
+| businessMethod | String(32) | 是  | 请求业务编号                              | MallAppCall\_ProductList         |
+| params         | String     | 是  | 请求业务参数                              | 业务参数全部序列化为JSON 字符串传递             |
+| nonceStr       | String(32) | 否  | ==如安全机制为签名,则必须传入== 随机字符串,长度要求在32位以内 | 5K8264ILTKCH16CQ2502SI8ZNMTM67VS |
+| sign           | String(32) | 否  | ==如安全机制为签名,则必须传入== 通过签名算法计算得出的签名值   |                                  |
+
+请求参数签名数据为
+
+```java
+content = "appid=" + x.getAppId() +
+            "&businessMethod=" + x.getBusinessMethod() +
+            "&params=" + x.getParams() +
+            "&nonceStr=" + x.getNonceStr();
+```
+
+### 返回参数
+
+| 参数       | 类型         | 必填 | 描述                                  | 示例值                              |
+| -------- | ---------- | -- | ----------------------------------- | -------------------------------- |
+| appId    | String(32) | 是  | 接口应用号                               | 123456789                        |
+| data     | String     | 是  | 请求业务返回值                             | 业务返回数据全部序列化为JSON 字符串传递           |
+| nonceStr | String(32) | 否  | ==如安全机制为签名,则必须传入== 随机字符串,长度要求在32位以内 | 5K8264ILTKCH16CQ2502SI8ZNMTM67VS |
+| sign     | String(32) | 否  | ==如安全机制为签名,则必须传入== 通过签名算法计算得出的签名值   |                                  |
+| httpCode | int        | 是  | 错误编号                                |                                  |
+| msg      | String     | 否  | 错误内容                                |                                  |
+
+### 错误码
+
+| 错误代码  | 描述                           | 原因                               | 解决方案 |
+| :---- | :--------------------------- | :------------------------------- | :--- |
+| 10001 | POST数据为空                     | http post无数据                     |      |
+| 10002 | JSON格式不正确                    | 接口对应的json数据格式不正确                 |      |
+| 10003 | 参数中缺少businessMethod          | 未传入businessMethod参数              |      |
+| 10004 | 参数中缺少clientCode              | 未传入clientCode参数                  |      |
+| 10005 | 未获取到clientCode对应商户信息         | clientCode由商城开发商提供               |      |
+| 10006 | 商户信息不正确                      |                                  |      |
+| 10007 | 参数中缺少appId                   | 未传入appId参数                       |      |
+| 10008 | 应用appId不存在/应用appId已禁用,无法调用接口 | appId传入错误或者不存在/应用appId已禁用,无法调用接口 |      |
+| 10009 | 签名错误                         | 签名错误                             |      |
+| 10012 | 网络通信错误                       | 网络通信错误,请稍后重试                     |      |
+
+## 安全规范
+
+### 签名工具
+
+RAS密钥可以使用支付宝提供的工具计算 [密钥生成工具](http://p.tb.cn/rmsportal_6680_secret_key_tools_RSA_win.zip) ![image](https://gw.alipayobjects.com/os/skylark-tools/public/files/15563f1b8da9cf77618487750d3fb2ff.png%26originHeight%3D1750%26originWidth%3D3533%26size%3D451811%26status%3Ddone%26width%3D746) 开发资源有限,目前只支持rsa,格式为pkcs8,长度为2048
+
+### 生成随机数算法
+
+API接口协议中包含字段nonceStr,主要保证签名不可预测。我们推荐生成随机数算法如下:调用随机数函数生成,将得到的值转换为字符串。
+
+## 接口链接
+
+**正式地址** **测试地址** [http://xxxxxxx\:xx/apis11/mallAppCall/gateway](http://xxxxxxx\:xx/apis20/mallAppCall/gateway)
+
+# 获取商品列表
+
+## 应用场景
+
+通过该接口获取商品列表
+
+## 请求参数
+
+| 参数             | 类型     | 必填 | 描述   | 参数值                      |
+| -------------- | ------ | -- | ---- | ------------------------ |
+| businessMethod | String | 是  | 业务编码 | MallAppCall\_ProductList |
+| params         | String | 是  | 业务参数 | JSON字符串,此接口传空即可          |
+
+## 返回结果
+
+data通过JSON反序列为商品列表数组
+
+| 变量名             | 描述     | 示例值  |
+| :-------------- | :----- | :--- |
+| id              | 商品id   | 1    |
+| idType          | 商品分类id | 1    |
+| productName     | 商品名称   | 无碳联单 |
+| productTypeName | 商品分类名称 | 联单票据 |
+
+# 获取商品详情
+
+## 应用场景
+
+获取商品详情,用于展示商品,进行报价。
+
+## 请求参数
+
+| 参数             | 类型     | 必填 | 描述   | 参数值                        |
+| :------------- | :----- | :- | :--- | :------------------------- |
+| businessMethod | String | 是  | 业务编码 | MallAppCall\_ProductDetail |
+| params         | String | 是  | 业务参数 | JSON字符串,此接口为{id:商品id}      |
+
+### params内容
+
+| 变量名 | 描述   | 示例值 |
+| :-- | :--- | :-- |
+| id  | 商品id | 1   |
+
+## 返回结果
+
+![image](https://gitee.com/jlutt/vNoteImage/raw/master/%E9%A1%B9%E7%9B%AE%E6%96%87%E6%A1%A3/erp%E5%A4%96%E5%8D%8F%E4%B8%89%E6%96%B9%E7%99%BB%E5%BD%95%E5%8F%8D%E9%A6%88.md/QQ%E5%9B%BE%E7%89%8720250308132130.png)
+
+data通过JSON反序列为商品详情信息
+
+### productInfo
+
+| 变量名             | 描述           | 示例值  |
+| :-------------- | :----------- | :--- |
+| id              | 商品id         | 1    |
+| idType          | 商品分类id       | 1    |
+| productTypeName | 商品分类名称       | 联单票据 |
+| productName     | 商品名称         | 无碳联单 |
+| productUnit     | 商品单位         | 本    |
+| priceQtyContent | 报价数量描述       |      |
+| minDeliveryDay  | 最短发货周期(天)    |      |
+| partInfoList    | 部件partInfo数组 |      |
+
+### partInfo部件信息
+
+| 变量名           | 描述                  | 示例值 |
+| :------------ | :------------------ | :-- |
+| id            | 部件id                |     |
+| partName      | 部件名称                |     |
+| parameterList | 报价参数parameterInfo数组 |     |
+
+### parameterInfo报价参数信息
+
+| 变量名           | 描述                  | 示例值 |
+| :------------ | :------------------ | :-- |
+| id            | 参数id                |     |
+| defaultValue  | 默认值                 |     |
+| idParameter   | 对应产品参数id            |     |
+| parameterName | 参数名称                |     |
+| itemList      | 参数项目parameterItem列表 |     |
+
+### parameterItem
+
+| 变量名         | 描述           | 示例值 |
+| :---------- | :----------- | :-- |
+| id          | 参数项目id       |     |
+| itemName    | 项目名称         |     |
+| itemValue   | 项目值          |     |
+| itemControl | 参数项目控制可选参数项目 |     |
+
+# 请求报价
+
+## 应用场景
+
+上传报价信息,获取结果。
+
+## 请求参数
+
+| 参数             | 类型     | 必填 | 描述   | 参数值                       |
+| :------------- | :----- | :- | :--- | :------------------------ |
+| businessMethod | String | 是  | 业务编码 | MallAppCall\_ProductQuote |
+| params         | String | 是  | 业务参数 | JSON字符串                   |
+
+### params内容
+
+此结构有些复杂,表格不方面进行描述,下面用代码说明json数据信息
+
+```json
+
+{
+  "idProduct": "产品id",
+  "kindCount": "款数",
+  "orderQty": "订单数量",
+  "quoteMemo": "报价说明",
+  "orderMemo": "订单备注",
+  "partList": [
+    {
+      "partName": "部件名称",
+      "paramValueList": [
+        {
+          "parameterName": "参数名称",
+          "paramValue": "参数值",
+          "paramDisplay": "参数显示值"
+        },
+        {
+          "parameterName": "参数名称",
+          "paramValue": "200克铜版C",
+          "paramDisplay": "200克铜版C"
+        }
+        .........
+      ]
+    }
+  ]
+}
+
+```
+
+## 返回结果
+
+| 变量名        | 描述   | 示例值 |
+| ---------- | ---- | --- |
+| TotalMoney | 商品货款 |     |
+

+ 38 - 8
yjBusiness/src/main/java/com/yinjie/heating/business/dao/HeatingDocDao.java

@@ -3,24 +3,54 @@ package com.yinjie.heating.business.dao;
 import com.dySweetFishPlugin.sql.dao.*;
 import com.sweetfish.source.PageFlipper;
 import com.yinjie.heating.common.entity.heating.HeatingApp;
+import com.yinjie.heating.common.entity.heating.HeatingAppInvoker;
 import org.rex.RMap;
 
 import java.util.List;
 
 public interface HeatingDocDao extends DaoRepository {
+    //region 热力服务商
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
     @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
-    @SqlId(clazz = HeatingDocDao.class, sql = "queryGasApp", table = "htHeatingApp", params = {1})
-    List<HeatingApp> selectAllGasApp(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode, PageFlipper pageFlipper);
+    @SqlId(clazz = HeatingDocDao.class, sql = "queryHeatingApp", table = "htHeatingApp", params = {1})
+    List<HeatingApp> selectAllHeatingApp(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode, PageFlipper pageFlipper);
 
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
     @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
-    @SqlId(clazz = HeatingDocDao.class, sql = "insertGasApp", table = "htHeatingApp", params = {1})
-    int addGasApp(HeatingApp app, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+    @SqlId(clazz = HeatingDocDao.class, sql = "addHeatingApp", table = "htHeatingApp", params = {1})
+    int addHeatingApp(HeatingApp app, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
 
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
     @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
-    @SqlId(clazz = HeatingDocDao.class, sql = "updateGasApp", table = "htHeatingApp", params = {1})
-    int updateGasApp(HeatingApp app, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+    @SqlId(clazz = HeatingDocDao.class, sql = "updateHeatingApp", table = "htHeatingApp", params = {1})
+    int updateHeatingApp(HeatingApp app, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
 
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
     @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
-    @SqlId(clazz = HeatingDocDao.class, sql = "voidGasApp", table = "htHeatingApp", params = {1})
-    int voidGasApp(HeatingApp app, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+    @SqlId(clazz = HeatingDocDao.class, sql = "voidHeatingApp", table = "htHeatingApp", params = {1})
+    int voidHeatingApp(HeatingApp app, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+    //endregion
+
+    //region 热力服务商已注册的接口
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
+    @DAOMethod(operator = OperatorType.QUERY, owait = OperatorWait.AWAIT)
+    @SqlId(clazz = HeatingDocDao.class, sql = "queryHeatingAppInvoker", table = "htHeatingAppInvoker", params = {1})
+    List<HeatingAppInvoker> selectAllHeatingAppInvoker(RMap params, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
+    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
+    @SqlId(clazz = HeatingDocDao.class, sql = "addHeatingAppInvoker", table = "htHeatingAppInvoker", params = {1})
+    int addHeatingAppInvoker(HeatingAppInvoker invoker, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
+    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
+    @SqlId(clazz = HeatingDocDao.class, sql = "updateHeatingAppInvoker", table = "htHeatingAppInvoker", params = {1})
+    int updateHeatingAppInvoker(HeatingAppInvoker invoker, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+
+    @Sharding(databaseShardingStrategy = SupplierDataBaseShardingStrategy.class, tableShardingStrategy = SupplierTableShardingStrategy.class)
+    @DAOMethod(operator = OperatorType.UPDATE, owait = OperatorWait.ASNYC)
+    @SqlId(clazz = HeatingDocDao.class, sql = "deleteHeatingAppInvoker", table = "htHeatingAppInvoker", params = {1})
+    int deleteHeatingAppInvoker(HeatingAppInvoker invoker, @DatabaseShardingBy String dataSourceId, @TableShardingBy Long supplierCode);
+    //endregion
+
 }

+ 0 - 165
yjBusiness/src/main/java/com/yinjie/heating/business/service/HeatingDocServiceImpl.java

@@ -1,165 +0,0 @@
-package com.yinjie.heating.business.service;
-
-import com.dySweetFishPlugin.redis.RedisService;
-import com.dySweetFishPlugin.sql.RMapUtils;
-import com.dySweetFishPlugin.sql.TableIdService;
-import com.sweetfish.convert.json.JsonConvert;
-import com.sweetfish.service.Local;
-import com.sweetfish.util.AutoLoad;
-import com.sweetfish.util.ResourceType;
-import com.yinjie.heating.business.dao.HeatingDocDao;
-import com.yinjie.heating.common.api.HeatingDocService;
-import com.yinjie.heating.common.base.BaseService;
-import com.yinjie.heating.common.datas.HttpCode;
-import com.yinjie.heating.common.datas.RedisKeys;
-import com.yinjie.heating.common.entity.heating.HeatingApp;
-import com.yinjie.heating.common.entity.system.LoginUser;
-import org.apache.commons.lang3.StringUtils;
-import org.rex.RMap;
-
-import javax.annotation.Resource;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-@AutoLoad(false)
-@Local
-@ResourceType(HeatingDocService.class)
-public class HeatingDocServiceImpl extends BaseService implements HeatingDocService {
-    @Resource
-    RedisService redisService;
-
-    @Resource
-    JsonConvert jsonConvert;
-
-    @Resource
-    TableIdService tableIdService;
-
-    private HeatingDocDao gasDocDao;
-
-    @Override
-    public HeatingApp getRedisGasApp(String appId) {
-        String json = redisService.hget(RedisKeys.KEY_HEATING_APP, appId);
-
-        if (StringUtils.isEmpty(json)) {
-            return null;
-        }
-
-        return jsonConvert.convertFrom(HeatingApp.class, json);
-    }
-
-    @Override
-    public RMap getGasAppList(RMap searchData) {
-        String searchAppName = "";
-        int searchStatus = -1;
-
-        if ((searchData != null) && (searchData.containsKey("appName"))) {
-            searchAppName = searchData.getString("appName");
-        }
-
-        if ((searchData != null) && (searchData.containsKey("status"))) {
-            searchStatus = searchData.getInt("status");
-        }
-
-        Map<String, String> appMap = redisService.hgetAll(RedisKeys.KEY_HEATING_APP);
-        List<HeatingApp> appList = new ArrayList<>();
-
-        final String finalAppName = searchAppName;
-        final int finalStatus = searchStatus;
-
-        appMap.forEach((k, v) -> {
-            HeatingApp gasApp = jsonConvert.convertFrom(HeatingApp.class, v);
-            boolean canAdd = true;
-
-            if (StringUtils.isNotEmpty(finalAppName)) {
-                canAdd = canAdd && (gasApp.getAppName().contains(finalAppName));
-            }
-
-            if (finalStatus >= 0) {
-                canAdd = canAdd && (gasApp.getStatus() == finalStatus);
-            }
-
-            if (canAdd) {
-                appList.add(gasApp);
-            }
-        });
-
-        //排序
-        appList.sort((v1, v2) -> {
-            return Long.compare(v1.getId(), v2.getId());
-        });
-
-        return RMapUtils.successV2(appList, null, null);
-    }
-
-    @Override
-    public RMap addGasApp(HeatingApp app, LoginUser currentUser) {
-        app.setId(tableIdService.getTableId("tbGasApp.id", 1));
-        app.setStatus(0);
-
-        HeatingApp.create(app, currentUser.getId());
-
-        redisService.hset(RedisKeys.KEY_HEATING_APP, app.getAppId(), jsonConvert.convertTo(app));
-
-        gasDocDao.addGasApp(app);
-
-        return RMapUtils.success();
-    }
-
-    @Override
-    public RMap updateGasApp(HeatingApp app, LoginUser currentUser) {
-        if (app == null) {
-            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
-        }
-
-        if (StringUtils.isEmpty(app.getAppId())) {
-            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
-        }
-
-        HeatingApp.update(app, currentUser.getId());
-
-        HeatingApp redisApp = getRedisGasApp(app.getAppId());
-        if (redisApp != null) {
-            redisApp.setAppName(app.getAppName());
-            redisApp.setAppPublicKey(app.getAppPublicKey());
-            redisApp.setAppPrivateKey(app.getAppPrivateKey());
-            redisApp.setSupplyPublicKey(app.getSupplyPublicKey());
-            redisApp.setVerifyKind(app.getVerifyKind());
-            redisApp.setWhiteIps(app.getWhiteIps());
-            redisApp.setUpdateBy(app.getUpdateBy());
-            redisApp.setUpdateTime(app.getUpdateTime());
-
-            redisService.hset(RedisKeys.KEY_HEATING_APP, redisApp.getAppId(), jsonConvert.convertTo(redisApp));
-
-            gasDocDao.updateGasApp(app);
-        }
-
-        return RMapUtils.success();
-    }
-
-    @Override
-    public RMap voidGasApp(HeatingApp app, LoginUser currentUser) {
-        if (app == null) {
-            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
-        }
-
-        if (StringUtils.isEmpty(app.getAppId())) {
-            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
-        }
-
-        HeatingApp.update(app, currentUser.getId());
-
-        HeatingApp redisApp = getRedisGasApp(app.getAppId());
-        if (redisApp != null) {
-            redisApp.setStatus(app.getStatus());
-            redisApp.setUpdateBy(app.getUpdateBy());
-            redisApp.setUpdateTime(app.getUpdateTime());
-
-            redisService.hset(RedisKeys.KEY_HEATING_APP, redisApp.getAppId(), jsonConvert.convertTo(redisApp));
-        }
-
-        gasDocDao.voidGasApp(app);
-
-        return RMapUtils.success();
-    }
-}

+ 49 - 0
yjBusiness/src/main/java/com/yinjie/heating/business/service/heating/CallThirdAppServiceImpl.java

@@ -0,0 +1,49 @@
+package com.yinjie.heating.business.service.heating;
+
+import com.sweetfish.service.RetResult;
+import com.yinjie.heating.common.api.heating.CallThirdAppService;
+import com.yinjie.heating.common.base.BaseService;
+import com.yinjie.heating.common.datas.ERPModule;
+import com.yinjie.heating.common.entity.base.ProcessMapItem;
+import com.yinjie.heating.common.entity.callthird.BaseResponse;
+import com.yinjie.heating.common.entity.heating.HeatingApp;
+import org.rex.RMap;
+
+import java.util.Date;
+
+public class CallThirdAppServiceImpl extends BaseService implements CallThirdAppService {
+    @Override
+    public RetResult<BaseResponse> callQueryFee(String billKey, HeatingApp heatingApp, String dataSourceId, long supplierCode) {
+        RMap reqBody = new RMap();
+        reqBody.put("billKey", billKey);
+        reqBody.put("app", heatingApp);
+
+
+        return handleScript("Call_QueryFee", ERPModule.CALL_THIRD, dataSourceId, supplierCode,
+                () -> ProcessMapItem.newBuilder()
+                        .itemData(reqBody)
+                        .dataSourceId(dataSourceId)
+                        .supplierCode(supplierCode)
+                        .build());
+
+    }
+
+    @Override
+    public RetResult<BaseResponse> callRequestPay(String billKey, Date payDate, String bankBillNo, String payAmount,
+                                                  HeatingApp heatingApp, String dataSourceId, long supplierCode) {
+        RMap reqBody = new RMap();
+        reqBody.put("billKey", billKey);
+        reqBody.put("app", heatingApp);
+        reqBody.put("payDate", payDate);
+        reqBody.put("bankBillNo", bankBillNo);
+        reqBody.put("payAmount", payAmount);
+
+
+        return handleScript("Call_RequestPay", ERPModule.CALL_THIRD, dataSourceId, supplierCode,
+                () -> ProcessMapItem.newBuilder()
+                        .itemData(reqBody)
+                        .dataSourceId(dataSourceId)
+                        .supplierCode(supplierCode)
+                        .build());
+    }
+}

+ 241 - 0
yjBusiness/src/main/java/com/yinjie/heating/business/service/heating/HeatingDocServiceImpl.java

@@ -0,0 +1,241 @@
+package com.yinjie.heating.business.service.heating;
+
+import com.dySweetFishPlugin.redis.RedisService;
+import com.dySweetFishPlugin.sql.RMapUtils;
+import com.dySweetFishPlugin.sql.TableIdService;
+import com.sweetfish.convert.json.JsonConvert;
+import com.sweetfish.service.Local;
+import com.sweetfish.util.AutoLoad;
+import com.sweetfish.util.ResourceType;
+import com.yinjie.heating.business.dao.HeatingDocDao;
+import com.yinjie.heating.common.api.heating.HeatingDocService;
+import com.yinjie.heating.common.api.NoSqlKeysService;
+import com.yinjie.heating.common.base.BaseService;
+import com.yinjie.heating.common.datas.HttpCode;
+import com.yinjie.heating.common.datas.RedisKeys;
+import com.yinjie.heating.common.entity.heating.HeatingApp;
+import com.yinjie.heating.common.entity.heating.HeatingAppInvoker;
+import com.yinjie.heating.common.entity.system.LoginUser;
+import org.apache.commons.lang3.StringUtils;
+import org.rex.RMap;
+
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+@AutoLoad(false)
+@Local
+@ResourceType(HeatingDocService.class)
+public class HeatingDocServiceImpl extends BaseService implements HeatingDocService {
+    @Resource
+    RedisService redisService;
+
+    @Resource
+    JsonConvert jsonConvert;
+
+    @Resource
+    TableIdService tableIdService;
+
+    @Resource
+    NoSqlKeysService keysService;
+
+    private HeatingDocDao heatingDocDao;
+
+    @Override
+    public HeatingApp getRedisHeatingApp(String appId, long supplierCode) {
+        String json = redisService.hget(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), appId);
+
+        if (StringUtils.isEmpty(json)) {
+            return null;
+        }
+
+        return jsonConvert.convertFrom(HeatingApp.class, json);
+    }
+
+    @Override
+    public RMap getHeatingAppList(RMap searchData, String dataSourceId, long supplierCode) {
+        String searchAppName = "";
+        int searchStatus = -1;
+
+        if ((searchData != null) && (searchData.containsKey("appName"))) {
+            searchAppName = searchData.getString("appName");
+        }
+
+        if ((searchData != null) && (searchData.containsKey("status"))) {
+            searchStatus = searchData.getInt("status");
+        }
+
+        Map<String, String> appMap = redisService.hgetAll(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode));
+        List<HeatingApp> appList = new ArrayList<>();
+
+        final String finalAppName = searchAppName;
+        final int finalStatus = searchStatus;
+
+        appMap.forEach((k, v) -> {
+            HeatingApp gasApp = jsonConvert.convertFrom(HeatingApp.class, v);
+            boolean canAdd = true;
+
+            if (StringUtils.isNotEmpty(finalAppName)) {
+                canAdd = canAdd && (gasApp.getAppName().contains(finalAppName));
+            }
+
+            if (finalStatus >= 0) {
+                canAdd = canAdd && (gasApp.getStatus() == finalStatus);
+            }
+
+            if (canAdd) {
+                appList.add(gasApp);
+            }
+        });
+
+        //排序
+        appList.sort((v1, v2) -> {
+            return Long.compare(v1.getId(), v2.getId());
+        });
+
+        return RMapUtils.successV2(appList, null, null);
+    }
+
+    @Override
+    public RMap addHeatingApp(HeatingApp app, LoginUser currentUser, String dataSourceId, long supplierCode) {
+        app.setId(tableIdService.getTableIdMulti("htHeatingApp.id", 1, dataSourceId, String.valueOf(supplierCode)));
+        app.setStatus(0);
+
+        HeatingApp.create(app, currentUser.getId());
+
+        redisService.hset(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), app.getAppId(), jsonConvert.convertTo(app));
+
+        heatingDocDao.addHeatingApp(app, dataSourceId, supplierCode);
+
+        return RMapUtils.success();
+    }
+
+    @Override
+    public RMap updateHeatingApp(HeatingApp app, LoginUser currentUser, String dataSourceId, long supplierCode) {
+        if (app == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+
+        if (StringUtils.isEmpty(app.getAppId())) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+
+        HeatingApp.update(app, currentUser.getId());
+
+        HeatingApp redisApp = getRedisHeatingApp(app.getAppId(), supplierCode);
+        if (redisApp != null) {
+            redisApp.setAppName(app.getAppName());
+            redisApp.setAppPublicKey(app.getAppPublicKey());
+            redisApp.setAppPrivateKey(app.getAppPrivateKey());
+            redisApp.setSupplyPublicKey(app.getSupplyPublicKey());
+            redisApp.setVerifyKind(app.getVerifyKind());
+            redisApp.setWhiteIps(app.getWhiteIps());
+            redisApp.setUpdateBy(app.getUpdateBy());
+            redisApp.setUpdateTime(app.getUpdateTime());
+
+            redisService.hset(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), redisApp.getAppId(), jsonConvert.convertTo(redisApp));
+
+            heatingDocDao.updateHeatingApp(app, dataSourceId, supplierCode);
+        }
+
+        return RMapUtils.success();
+    }
+
+    @Override
+    public RMap voidHeatingApp(HeatingApp app, LoginUser currentUser, String dataSourceId, long supplierCode) {
+        if (app == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+
+        if (StringUtils.isEmpty(app.getAppId())) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+
+        HeatingApp.update(app, currentUser.getId());
+
+        HeatingApp redisApp = getRedisHeatingApp(app.getAppId(), supplierCode);
+        if (redisApp != null) {
+            redisApp.setStatus(app.getStatus());
+            redisApp.setUpdateBy(app.getUpdateBy());
+            redisApp.setUpdateTime(app.getUpdateTime());
+
+            redisService.hset(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), redisApp.getAppId(), jsonConvert.convertTo(redisApp));
+        }
+
+        heatingDocDao.voidHeatingApp(app, dataSourceId, supplierCode);
+
+        return RMapUtils.success();
+    }
+
+    @Override
+    public RMap addHeatingAppInvoker(HeatingAppInvoker invoker, LoginUser currentUser, String dataSourceId, long supplierCode) {
+        invoker.setId(tableIdService.getTableIdMulti("htHeatingAppInvoker.id", 1, dataSourceId, String.valueOf(supplierCode)));
+
+        HeatingAppInvoker.create(invoker, currentUser.getId());
+        //取出来当前的app
+        HeatingApp app = getRedisHeatingApp(invoker.getAppId(), supplierCode);
+        if (app == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "错误的AppId");
+        }
+
+        app.getInvokerList().add(invoker);
+        redisService.hset(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), app.getAppId(), jsonConvert.convertTo(app));
+
+        heatingDocDao.addHeatingAppInvoker(invoker, dataSourceId, supplierCode);
+
+        return RMapUtils.success();
+    }
+
+    @Override
+    public RMap updateHeatingAppInvoker(HeatingAppInvoker invoker, LoginUser currentUser, String dataSourceId, long supplierCode) {
+        if (invoker == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+
+        if (invoker.getId() <= 0 || StringUtils.isEmpty(invoker.getAppId())) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+        //取出来当前的app
+        HeatingApp app = getRedisHeatingApp(invoker.getAppId(), supplierCode);
+        if (app == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "错误的AppId");
+        }
+
+        app.getInvokerList().stream().filter(x -> x.getId() == invoker.getId()).findFirst().ifPresent(x -> {
+            x.setInvokerName(invoker.getInvokerName());
+            x.setDescription(invoker.getDescription());
+            x.setInvokerCode(invoker.getInvokerCode());
+            x.setInvokerUrl(invoker.getInvokerUrl());
+
+            HeatingAppInvoker.update(x, currentUser.getId());
+        });
+        redisService.hset(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), app.getAppId(), jsonConvert.convertTo(app));
+
+        heatingDocDao.updateHeatingAppInvoker(invoker, dataSourceId, supplierCode);
+        return RMapUtils.success();
+    }
+
+    @Override
+    public RMap deleteHeatingAppInvoker(HeatingAppInvoker invoker, LoginUser currentUser, String dataSourceId, long supplierCode) {
+        if (invoker == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+
+        if (invoker.getId() <= 0 || StringUtils.isEmpty(invoker.getAppId())) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "请求数据错误");
+        }
+        //取出来当前的app
+        HeatingApp app = getRedisHeatingApp(invoker.getAppId(), supplierCode);
+        if (app == null) {
+            return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "错误的AppId");
+        }
+
+        app.getInvokerList().remove(app.getInvokerList().stream().filter(y -> y.getId() == invoker.getId()).findFirst().orElse(null));
+
+        redisService.hset(keysService.getRedisKey(RedisKeys.KEY_HEATING_APP, supplierCode), app.getAppId(), jsonConvert.convertTo(app));
+
+        heatingDocDao.deleteHeatingAppInvoker(invoker, dataSourceId, supplierCode);
+        return RMapUtils.success();
+    }
+}

+ 0 - 26
yjCommon/src/main/java/com/yinjie/heating/common/api/HeatingDocService.java

@@ -1,26 +0,0 @@
-package com.yinjie.heating.common.api;
-
-import com.yinjie.heating.common.entity.heating.HeatingApp;
-import com.yinjie.heating.common.entity.system.LoginUser;
-import org.rex.RMap;
-
-public interface HeatingDocService extends ScriptService {
-
-    HeatingApp getRedisGasApp(String appId);
-
-    /**
-     * 获取APP列表列表
-     * 从redis中获取
-     *
-     * @param searchData
-     * @return
-     */
-    RMap getGasAppList(RMap searchData);
-
-    RMap addGasApp(HeatingApp app, LoginUser currentUser);
-
-    RMap updateGasApp(HeatingApp app, LoginUser currentUser);
-
-    RMap voidGasApp(HeatingApp app, LoginUser currentUser);
-
-}

+ 25 - 0
yjCommon/src/main/java/com/yinjie/heating/common/api/heating/CallThirdAppService.java

@@ -0,0 +1,25 @@
+package com.yinjie.heating.common.api.heating;
+
+import com.sweetfish.service.RetResult;
+import com.sweetfish.util.AutoLoad;
+import com.yinjie.heating.common.api.ScriptService;
+import com.yinjie.heating.common.entity.callthird.BaseRequest;
+import com.yinjie.heating.common.entity.callthird.BaseResponse;
+import com.yinjie.heating.common.entity.heating.HeatingApp;
+import com.yinjie.heating.common.entity.heating.HeatingAppInvoker;
+import com.yinjie.heating.common.entity.system.LoginUser;
+import org.rex.RMap;
+
+import java.util.Date;
+
+/**
+ * 调用三方热力公司接口
+ */
+@AutoLoad(false)
+public interface CallThirdAppService extends ScriptService {
+    RetResult<BaseResponse> callQueryFee(String billKey, HeatingApp heatingApp, String dataSourceId, long supplierCode);
+
+    RetResult<BaseResponse> callRequestPay(String billKey, Date payDate, String bankBillNo, String payAmount,
+                                           HeatingApp heatingApp, String dataSourceId, long supplierCode);
+
+}

+ 38 - 0
yjCommon/src/main/java/com/yinjie/heating/common/api/heating/HeatingDocService.java

@@ -0,0 +1,38 @@
+package com.yinjie.heating.common.api.heating;
+
+import com.sweetfish.util.AutoLoad;
+import com.yinjie.heating.common.api.ScriptService;
+import com.yinjie.heating.common.entity.heating.HeatingApp;
+import com.yinjie.heating.common.entity.heating.HeatingAppInvoker;
+import com.yinjie.heating.common.entity.system.LoginUser;
+import org.rex.RMap;
+
+@AutoLoad(false)
+public interface HeatingDocService extends ScriptService {
+
+    HeatingApp getRedisHeatingApp(String appId, long supplierCode);
+
+    /**
+     * 获取APP列表列表
+     * 从redis中获取
+     *
+     * @param searchData
+     * @return
+     */
+    RMap getHeatingAppList(RMap searchData, String dataSourceId, long supplierCode);
+
+    RMap addHeatingApp(HeatingApp app, LoginUser currentUser, String dataSourceId, long supplierCode);
+
+    RMap updateHeatingApp(HeatingApp app, LoginUser currentUser, String dataSourceId, long supplierCode);
+
+    RMap voidHeatingApp(HeatingApp app, LoginUser currentUser, String dataSourceId, long supplierCode);
+
+
+
+    RMap addHeatingAppInvoker(HeatingAppInvoker invoker, LoginUser currentUser, String dataSourceId, long supplierCode);
+
+    RMap updateHeatingAppInvoker(HeatingAppInvoker invoker, LoginUser currentUser, String dataSourceId, long supplierCode);
+
+    RMap deleteHeatingAppInvoker(HeatingAppInvoker invoker, LoginUser currentUser, String dataSourceId, long supplierCode);
+
+}

+ 1 - 5
yjCommon/src/main/java/com/yinjie/heating/common/datas/ERPModule.java

@@ -36,11 +36,7 @@ public enum ERPModule {
 
     DATA_SYNC(154, "dataSync", "数据库同步ES", "", "sync"),
 
-    EXPRESS_API(200, "expressApi", "配送平台接口", "", "expressApi"),
-
-    ORDER_API(300, "orderApi", "订单平台接口", "", "orderApi"),
-    STORE_API(400, "storeAPi", "平台门店接口", "", "storeApi"),
-    PLATFORM_TOKEN(500, "platformToken", "平台access-token管理", "", "platformToken");
+    CALL_THIRD(200, "callThird", "调用三方接口", "", "callThird");
 
 
     private int value;

+ 42 - 0
yjCommon/src/main/java/com/yinjie/heating/common/datas/HeatingAppInvokerCode.java

@@ -0,0 +1,42 @@
+package com.yinjie.heating.common.datas;
+
+import java.util.Objects;
+
+/**
+ * 三方热力系统接口类型
+ */
+@SuppressWarnings("unused")
+public enum HeatingAppInvokerCode {
+    queryFee("查询欠费", "queryFee"),
+    requestPay("请求销账", "requestPay");
+    private String name;
+    private String code;
+
+    HeatingAppInvokerCode(String name, String code) {
+        this.name = name;
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public static String getName(String code) {
+        for (HeatingAppInvokerCode p : HeatingAppInvokerCode.values()) {
+            if (Objects.equals(p.getCode(), code)) return p.getName();
+        }
+        return null;
+    }
+}

+ 1 - 151
yjCommon/src/main/java/com/yinjie/heating/common/datas/RedisKeys.java

@@ -140,11 +140,6 @@ public class RedisKeys {
 
 
     /**
-     * 版的版心尺寸
-     */
-    public static final String KEY_ERP_BREEDPLATESIZE = "redis.erp.breedplatesize";
-
-    /**
      * 查询统计
      */
     public static final String KEY_ERP_INQUIREINFO = "redis.erp.inquireinfo";
@@ -170,11 +165,6 @@ public class RedisKeys {
     public static final String KEY_ERP_LOCK_USERDATA = "redis.erplock.userdata";
 
     /**
-     * 专班组版workpart锁定
-     */
-    public static final String KEY_ERP_EXCLUSIVE_LOCKPART = "redis.erplock.exclusivelockpart";
-
-    /**
      * 系统默认需要的配置,防止未初始化,客户端报错
      */
     public static final String[] SUPPLIER_SYSTEM_CONFIGARR = {
@@ -206,148 +196,8 @@ public class RedisKeys {
     //分厂
     public static final String KEY_COMPANY_INFO = "redis.company.info";
 
-    //产品
-    public static final String KEY_PRODUCT_INFO = "redis.erp.product.info";
-
-    public static final String KEY_PRODUCT_DETAIL = "redis.erp.product.detail";
-
-    public static final String KEY_PRODUCT_TYPE = "redis.erp.product.type";
-    public static final String KEY_PRODUCT_PARAMETER = "redis.erp.product.parameter";
-
-    public static final String KEY_PRODUCT_PAGE_PRICE_INFO = "redis.erp.product.pagePrice";
-
-    public static final String KEY_PRODUCT_EXAMPLE_IMAGE = "redis.erp.product.example.image";
-
-    public static final String KEY_PRODUCT_ROOM = "redis.erp.product.room";
-
-    /**
-     * 订单生命周期list池,单线程读取写入数据库
-     */
-    public static final String KEY_ERP_ORDER_CYCLE_ITEM = "redis.erp.order.cycle.item";
-
-    //region 客户
-
-    public static final String KEY_ERP_CLIENT_INDUSTRY_INFO = "redis.erp.client.industry.info";
-
-    /**
-     * 客户余额
-     */
-    public static final String KEY_ERP_CLIENT_BALANCE = "redis.erp.client.moneybalance";
-
-    public static final String KEY_ERP_CLIENT_LEVEL = "redis.erp.client.clientlevel";
-
-    //endregion
-
-    //region 纸张相关
-    public static final String KEY_ERP_PAPER_BRAND = "redis.erp.paper.brand";
-    //纸张开数档案
-    public static final String KEY_ERP_PAPER_CUT_INFO = "redis.erp.paper.cut.info";
-    //开纸尺寸档案
-    public static final String KEY_ERP_PAPER_CUT_SIZE_INFO = "redis.erp.paper.cut.size.info";
-
-    //endregion
-
-    /**
-     * 机型机台
-     */
-    public static final String KEY_ERP_MACHINE_TYPE = "redis.erp.machine.type";
-    public static final String KEY_ERP_MACHINE_INFO = "redis.erp.machine.info";
-
-    public static final String KEY_ERP_DEVELOP_CLIENT_INFO = "redis.erp.develop.client";
-
-    public static final String KEY_ERP_DEVELOP_CLIENT_CODE = "redis.erp.develop.client.code";
-
-    //region 进销存
-
-    /**
-     * 单据定义
-     */
-    public static final String KEY_BILLDEFINE = "redis.billdefine";
-
-    /**
-     * 库房
-     */
-    public static final String KEY_STOCKROOM = "redis.stockroom";
-
-    /**
-     * 分厂
-     */
-    public static final String KEY_COMPANYINFO = "redis.companyinfo";
-
-
-    //endregion
-
-    //region 库存
-
-
-    /**
-     * 辅料纸张数量库存
-     */
-    public static final String KEY_ERP_MATERIAL_QTY_BALANCE = "redis.erp.material.qty.balance";
-
-    //endregion
-
-
-    /**
-     * 平台档案
-     */
-    public static final String KEY_DELIVER_PLATFORM_INFO = "redis.deliver.platforminfo";
-
-    /**
-     * 平台档案
-     */
-    public static final String KEY_DELIVER_PLATFORM_REQUIRE = "redis.deliver.platformrequire";
-
-    //region 锁定数据
-
-    public static final String KEY_ERP_WORKING_ORDER = "redis.erp.working.order";
-
-    //顺丰同城订单
-    public static final String KEY_ERP_WORKING_SF_ORDER = "redis.erp.working.express.sf.order";
-
-    //顺丰同城店铺
-    public static final String KEY_ERP_WORKING_SF_STORE = "redis.erp.working.express.sf.store";
-
-    //endregion
-
-    /**
-     * 抖音access-token上次刷新的时间
-     * 将废弃
-     */
-    public static final String KEY_DOUYIN_LASTTOKENDATE = "redis.douyin.lasttokendate";
-
-    /**
-     * 抖音access-token
-     * 将废弃
-     */
-    public static final String KEY_DOUYIN_ACCESSTOKEN = "redis.douyin.accesstoken";
-
-
-    /**
-     * 平台access-token上次刷新的时间
-     */
-    public static final String KEY_PLATFORM_LASTTOKENDATE = "redis.platform.lasttokendate";
-
-    /**
-     * 平台access-token
-     */
-    public static final String KEY_PLATFORM_ACCESSTOKEN = "redis.platform.accesstoken";
-
-    /**
-     * 订单流水号
-     */
-    public static final String KEY_ORDER_SHOP_SEQUENCE = "redis.erp.order.shop.sequence";
-
-    /**
-     * 抖音推送消息msg_id,用于记录避免重复处理
-     */
-    public static final String KEY_DOUYIN_CALL_MSG_ID = "redis.deliver.douyin.call.msgid";
-
-    /**
-     * 订单骑手坐标
-     */
-    public static final String KEY_ERP_ORDER_RIDER_GEO = "redis.erp.order.rider.geo";
 
+    //热力服务商-包含注册接口
     public static final String KEY_HEATING_APP = "redis.heating.app";
 
     private RedisKeys() {

+ 57 - 0
yjCommon/src/main/java/com/yinjie/heating/common/entity/callthird/BaseRequest.java

@@ -0,0 +1,57 @@
+package com.yinjie.heating.common.entity.callthird;
+
+import com.yinjie.heating.common.entity.base.BaseEntity;
+
+import java.util.HashMap;
+
+public class BaseRequest extends BaseEntity {
+    private String appId;
+
+    private HashMap<String, Object> params;
+
+    private String nonceStr;
+
+    private String sign;
+
+    private long timeStamp;
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public HashMap<String, Object> getParams() {
+        return params;
+    }
+
+    public void setParams(HashMap<String, Object> params) {
+        this.params = params;
+    }
+
+    public String getNonceStr() {
+        return nonceStr;
+    }
+
+    public void setNonceStr(String nonceStr) {
+        this.nonceStr = nonceStr;
+    }
+
+    public String getSign() {
+        return sign;
+    }
+
+    public void setSign(String sign) {
+        this.sign = sign;
+    }
+
+    public long getTimeStamp() {
+        return timeStamp;
+    }
+
+    public void setTimeStamp(long timeStamp) {
+        this.timeStamp = timeStamp;
+    }
+}

+ 57 - 0
yjCommon/src/main/java/com/yinjie/heating/common/entity/callthird/BaseResponse.java

@@ -0,0 +1,57 @@
+package com.yinjie.heating.common.entity.callthird;
+
+import com.yinjie.heating.common.entity.base.BaseEntity;
+
+import java.util.HashMap;
+
+public class BaseResponse extends BaseEntity {
+    private String appId;
+
+    private String respCode;
+
+    private String respMsg;
+
+    private HashMap<String, Object> respData;
+
+    private long timeStamp;
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getRespCode() {
+        return respCode;
+    }
+
+    public void setRespCode(String respCode) {
+        this.respCode = respCode;
+    }
+
+    public String getRespMsg() {
+        return respMsg;
+    }
+
+    public void setRespMsg(String respMsg) {
+        this.respMsg = respMsg;
+    }
+
+    public HashMap<String, Object> getRespData() {
+        return respData;
+    }
+
+    public void setRespData(HashMap<String, Object> respData) {
+        this.respData = respData;
+    }
+
+    public long getTimeStamp() {
+        return timeStamp;
+    }
+
+    public void setTimeStamp(long timeStamp) {
+        this.timeStamp = timeStamp;
+    }
+}

+ 24 - 11
yjCommon/src/main/java/com/yinjie/heating/common/entity/heating/HeatingApp.java

@@ -4,6 +4,8 @@ import com.sweetfish.util.Comment;
 import com.yinjie.heating.common.entity.base.BaseEntity;
 import org.rex.db.RColumn;
 
+import java.util.List;
+
 /**
  * Created by jlutt on 2019-05-31.
  * 缴费对外应用接口
@@ -11,50 +13,53 @@ import org.rex.db.RColumn;
  */
 public class HeatingApp extends BaseEntity {
 
-  @Comment("id")
   @RColumn("id")
+  @Comment("id")
   private long id;
 
-  @Comment("appid应用id,要保证唯一")
   @RColumn("appid")
+  @Comment("appid应用id,要保证唯一")
   private String appId;
 
-  @Comment("appid应用名称")
   @RColumn("appname")
+  @Comment("appid应用名称")
   private String appName;
 
-  @Comment("应用公钥,提供给开发商,验证签名")
   @RColumn("apppublickey")
+  @Comment("应用公钥,提供给开发商,验证签名")
   private String appPublicKey;
 
-  @Comment("应用私钥,给服务商使用,发送给开发商内容进行加签")
   @RColumn("appprivatekey")
+  @Comment("应用私钥,给服务商使用,发送给开发商内容进行加签")
   private String appPrivateKey;
 
-  @Comment("开发商上传的公钥,用于服务商在开发商调用接口时验签")
   @RColumn("supplypublickey")
+  @Comment("开发商上传的公钥,用于服务商在开发商调用接口时验签")
   private String supplyPublicKey;
 
-  @Comment("应用状态0正常 1禁用")
   @RColumn("status")
+  @Comment("应用状态0正常 1禁用")
   private int status;
 
-  @Comment("收款来源 请从2开始 0现金 1支付宝已经占用,不要重复")
   @RColumn("chargefrom")
+  @Comment("收款来源 请从2开始 0现金 1支付宝已经占用,不要重复")
   private int chargeFrom;
 
-  @Comment("对应收费操作人名称")
   @RColumn("chargeusername")
+  @Comment("对应收费操作人名称")
   private String chargeUserName;
 
-  @Comment("验证方式 0密钥验证 1ip限制")
   @RColumn("verifykind")
+  @Comment("验证方式 0密钥验证 1ip限制")
   private int verifyKind;
 
-  @Comment("白名单ip,多个用逗号分隔")
   @RColumn("whiteips")
+  @Comment("白名单ip,多个用逗号分隔")
   private String whiteIps;
 
+  @Comment("已注册的接口")
+  private List<HeatingAppInvoker> invokerList;
+
   public long getId() {
     return id;
   }
@@ -142,4 +147,12 @@ public class HeatingApp extends BaseEntity {
   public void setWhiteIps(String whiteIps) {
     this.whiteIps = whiteIps;
   }
+
+  public List<HeatingAppInvoker> getInvokerList() {
+    return invokerList;
+  }
+
+  public void setInvokerList(List<HeatingAppInvoker> invokerList) {
+    this.invokerList = invokerList;
+  }
 }

+ 91 - 0
yjCommon/src/main/java/com/yinjie/heating/common/entity/heating/HeatingAppInvoker.java

@@ -0,0 +1,91 @@
+package com.yinjie.heating.common.entity.heating;
+
+import com.sweetfish.util.Comment;
+import com.yinjie.heating.common.entity.base.BaseEntity;
+import org.rex.db.RColumn;
+
+public class HeatingAppInvoker extends BaseEntity {
+    @RColumn("id")
+    @Comment("")
+    private long id;
+
+    @RColumn("appid")
+    @Comment("关联的appId")
+    private String appId;
+
+    @Comment("appName")
+    @RColumn("appname")
+    private String appName;
+
+    @RColumn("invokername")
+    @Comment("接口名称")
+    private String invokerName;
+
+    @RColumn("invokercode")
+    @Comment("接口code")
+    private String invokerCode;
+
+    @RColumn("description")
+    @Comment("描述")
+    private String description;
+
+    @RColumn("invokerurl")
+    @Comment("接口地址")
+    private String invokerUrl;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public String getAppName() {
+        return appName;
+    }
+
+    public void setAppName(String appName) {
+        this.appName = appName;
+    }
+
+    public String getInvokerName() {
+        return invokerName;
+    }
+
+    public void setInvokerName(String invokerName) {
+        this.invokerName = invokerName;
+    }
+
+    public String getInvokerCode() {
+        return invokerCode;
+    }
+
+    public void setInvokerCode(String invokerCode) {
+        this.invokerCode = invokerCode;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getInvokerUrl() {
+        return invokerUrl;
+    }
+
+    public void setInvokerUrl(String invokerUrl) {
+        this.invokerUrl = invokerUrl;
+    }
+}

+ 137 - 108
yjWebCore/src/main/java/com/yinjie/heating/webcore/servlet/ThirdInvokeServlet.java

@@ -3,10 +3,14 @@ package com.yinjie.heating.webcore.servlet;
 import com.dySweetFishPlugin.tool.lang.DateUtil;
 import com.fasterxml.jackson.dataformat.xml.XmlMapper;
 import com.sweetfish.net.http.*;
+import com.sweetfish.service.RetResult;
 import com.sweetfish.util.AnyValue;
 import com.sweetfish.util.AutoLoad;
-import com.yinjie.heating.common.api.HeatingDocService;
+import com.yinjie.heating.common.api.heating.CallThirdAppService;
+import com.yinjie.heating.common.api.heating.HeatingDocService;
 import com.yinjie.heating.common.base.ERPAdminHttpServlet;
+import com.yinjie.heating.common.entity.callthird.BaseRequest;
+import com.yinjie.heating.common.entity.callthird.BaseResponse;
 import com.yinjie.heating.common.entity.ceb.CEBInvokeHeader;
 import com.yinjie.heating.common.entity.ceb.CEBRequestItem;
 import com.yinjie.heating.common.entity.ceb.CEBResponseItem;
@@ -30,11 +34,17 @@ import java.util.concurrent.CompletableFuture;
 public class ThirdInvokeServlet extends ERPAdminHttpServlet {
 
     @Resource
-    HeatingDocService gasDocService;
+    HeatingDocService heatingDocService;
 
+    @Resource
+    CallThirdAppService callThirdAppService;
 
     private XmlMapper xmlMapper;
 
+    //写死算了,没啥用
+    private final String DATA_SOURCE_ID = "erp001";
+    private final long SUPPLIER_CODE = 1000L;
+
     //光大appId,写死算了,没有这个id获取不到解密key,不解密就获取不到他传过来的appId.....
     private static final String CEB_APP_ID = "CEB20240909";
     private static final String CEB_SM4_KEY = "a63e5f89caed5d17b62553d0725d47da";
@@ -54,18 +64,19 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
 //            String reqStr = request.getBody(StandardCharsets.UTF_8); //测试
             try {
                 Map<String, Object> respBody = new HashMap<>();
-                HeatingApp gasApp = gasDocService.getRedisGasApp(CEB_APP_ID);
-                boolean errorFlag = false;
-                if (gasApp == null) {
-                    //本地配置错误,但是也无法解密了
-                    logger.error("未找到应用APPID");
-                    return "未找到应用APPID";
-                }
-                if (gasApp.getStatus() > 0) {
-                    respBody.put("ErrorCode", "DEF0006");
-                    respBody.put("ErrorInfo", "应用APPID已禁用,请联系服务开发商");
-                    errorFlag = true;
-                }
+                // 此系统当前仅支持光大一家平台商就行了,以后有需要再说
+//                HeatingApp gasApp = gasDocService.getRedisGasApp(CEB_APP_ID);
+//                boolean errorFlag = false;
+//                if (gasApp == null) {
+//                    //本地配置错误,但是也无法解密了
+//                    logger.error("未找到应用APPID");
+//                    return "未找到应用APPID";
+//                }
+//                if (gasApp.getStatus() > 0) {
+//                    respBody.put("ErrorCode", "DEF0006");
+//                    respBody.put("ErrorInfo", "应用APPID已禁用,请联系服务开发商");
+//                    errorFlag = true;
+//                }
 
                 //解密
 //                String decodeStr = SM4Utils.decryptEcb(gasApp.getAppPublicKey(), reqStr, SM4Utils.ENCODING);
@@ -73,22 +84,25 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
                 String decodeStr = reqStr;
                 CEBRequestItem requestItem = xmlMapper.readValue(decodeStr, CEBRequestItem.class);
 
-                //todo 业务代码
-                if (!errorFlag) {
-                    Map<String, Object> bodyMap = requestItem.getBody();
-
-                    switch (requestItem.getInvokeHeader().getfTranCode()) {
-                        case "BJ01":
-                            respBody = queryBillsToPay(bodyMap, gasApp);
-                            break;
-                        case "BJ02":
-                            respBody = payBill(bodyMap, gasApp);
-                            break;
-                        case "BJ05":
-                            respBody = reqInvoice(bodyMap, gasApp);
-                            break;
-                    }
+//                if (!errorFlag) {
+                //获取光大请求过来的appId
+                String appId = requestItem.getInvokeHeader().getInstID();
+                HeatingApp heatingApp = heatingDocService.getRedisHeatingApp(appId, SUPPLIER_CODE);
+
+                Map<String, Object> bodyMap = requestItem.getBody();
+
+                switch (requestItem.getInvokeHeader().getfTranCode()) {
+                    case "BJ01":
+                        respBody = queryBillsToPay(bodyMap, heatingApp);
+                        break;
+                    case "BJ02":
+                        respBody = payBill(bodyMap, heatingApp);
+                        break;
+                    case "BJ05":
+                        respBody = reqInvoice(bodyMap, heatingApp);
+                        break;
                 }
+//                }
 
                 CEBResponseItem responseItem = new CEBResponseItem();
                 if (respBody.containsKey("ErrorCode")) {
@@ -121,7 +135,7 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
     }
 
     //查询待缴费
-    private Map<String, Object> queryBillsToPay(Map<String, Object> reqBody, HeatingApp gasApp) {
+    private Map<String, Object> queryBillsToPay(Map<String, Object> reqBody, HeatingApp heatingApp) {
         Map<String, Object> respBody = new HashMap<>();
         if (!reqBody.containsKey("billKey")) {
             respBody.put("ErrorCode", "DEF0010");
@@ -130,28 +144,31 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
         }
 
         String billKey = reqBody.get("billKey").toString();
-        QueryOrderResult orderResult = gasFeeService.apiQueryFeeInfo(billKey);
-        if (!orderResult.getErrCode().equals("00000")) {
+        BaseResponse orderResult = callThirdAppService.callQueryFee(billKey, heatingApp, DATA_SOURCE_ID, SUPPLIER_CODE).getResult();
+        if (!orderResult.getRespCode().equals("00000")) {
             //将我们的错误代码翻译成光大的
-            switch (orderResult.getErrCode()) {
-                case "10005":
-                    respBody.put("ErrorCode", "DEF0002");
-                    respBody.put("ErrorInfo", "用户未欠费");
-                    break;
-                case "10001":
-                    respBody.put("ErrorCode", "DEF0005");
-                    respBody.put("ErrorInfo", "超过缴费时间");
-                    break;
-                case "10002":
-                    respBody.put("ErrorCode", "DEF0010");
-                    respBody.put("ErrorInfo", "用户不存在");
-                    break;
-                case "10003":
-                case "10004":
-                    respBody.put("ErrorCode", "DEF0012");
-                    respBody.put("ErrorInfo", "该用户不支持网上缴费,请联系公共事业单位");
-                    break;
-            }
+//            switch (orderResult.getErrCode()) {
+//                case "10005":
+//                    respBody.put("ErrorCode", "DEF0002");
+//                    respBody.put("ErrorInfo", "用户未欠费");
+//                    break;
+//                case "10001":
+//                    respBody.put("ErrorCode", "DEF0005");
+//                    respBody.put("ErrorInfo", "超过缴费时间");
+//                    break;
+//                case "10002":
+//                    respBody.put("ErrorCode", "DEF0010");
+//                    respBody.put("ErrorInfo", "用户不存在");
+//                    break;
+//                case "10003":
+//                case "10004":
+//                    respBody.put("ErrorCode", "DEF0012");
+//                    respBody.put("ErrorInfo", "该用户不支持网上缴费,请联系公共事业单位");
+//                    break;
+//            }
+            //我们自己将错误代码定的和光大一样即可
+            respBody.put("ErrorCode", orderResult.getRespCode());
+            respBody.put("ErrorInfo", orderResult.getRespMsg());
 
             return respBody;
         } else {
@@ -161,9 +178,13 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
 
             Map<String, Object> frame = new HashMap<>();
             frame.put("contractNo", billKey);
-            frame.put("customerName", orderResult.getCustomerName());
-            frame.put("balance", CommonUtils.money(orderResult.getCustomerBalance()));
-            frame.put("payAmount", CommonUtils.money(orderResult.getTotalOweAmt()));
+
+            //三方返回 customerName 用户名称
+            frame.put("customerName", orderResult.getRespData().get("customerName"));
+            //三方返回 customerBalance 用户余额(分)
+            frame.put("balance", CommonUtils.money(Long.parseLong(orderResult.getRespData().get("customerBalance").toString())));
+            //三方返回 customerPayAmount 用户欠款(分)
+            frame.put("payAmount", CommonUtils.money(Long.parseLong(orderResult.getRespData().get("customerPayAmount").toString())));
 
             respBody.put("Frame", frame);
         }
@@ -171,7 +192,7 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
     }
 
     //缴费销账
-    private Map<String, Object> payBill(Map<String, Object> reqBody, HeatingApp gasApp) {
+    private Map<String, Object> payBill(Map<String, Object> reqBody, HeatingApp heatingApp) {
         Map<String, Object> respBody = new HashMap<>();
         if (!reqBody.containsKey("billKey")) {
             respBody.put("ErrorCode", "DEF0010");
@@ -198,32 +219,35 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
         }
 
         //光大要求缴费金额必须等于欠费金额
-        QueryOrderResult orderResult = gasFeeService.apiQueryFeeInfo(billKey);
-        if (!orderResult.getErrCode().equals("00000")) {
+        BaseResponse orderResult = callThirdAppService.callQueryFee(billKey, heatingApp, DATA_SOURCE_ID, SUPPLIER_CODE).getResult();
+        if (!orderResult.getRespCode().equals("00000")) {
             //将我们的错误代码翻译成光大的
-            switch (orderResult.getErrCode()) {
-                case "10005":
-                    respBody.put("ErrorCode", "DEF0002");
-                    respBody.put("ErrorInfo", "用户未欠费");
-                    break;
-                case "10001":
-                    respBody.put("ErrorCode", "DEF0005");
-                    respBody.put("ErrorInfo", "超过缴费时间");
-                    break;
-                case "10002":
-                    respBody.put("ErrorCode", "DEF0010");
-                    respBody.put("ErrorInfo", "用户不存在");
-                    break;
-                case "10003":
-                case "10004":
-                    respBody.put("ErrorCode", "DEF0012");
-                    respBody.put("ErrorInfo", "该用户不支持网上缴费,请联系公共事业单位");
-                    break;
-            }
+//            switch (orderResult.getErrCode()) {
+//                case "10005":
+//                    respBody.put("ErrorCode", "DEF0002");
+//                    respBody.put("ErrorInfo", "用户未欠费");
+//                    break;
+//                case "10001":
+//                    respBody.put("ErrorCode", "DEF0005");
+//                    respBody.put("ErrorInfo", "超过缴费时间");
+//                    break;
+//                case "10002":
+//                    respBody.put("ErrorCode", "DEF0010");
+//                    respBody.put("ErrorInfo", "用户不存在");
+//                    break;
+//                case "10003":
+//                case "10004":
+//                    respBody.put("ErrorCode", "DEF0012");
+//                    respBody.put("ErrorInfo", "该用户不支持网上缴费,请联系公共事业单位");
+//                    break;
+//            }
+            //我们自己将错误代码定的和光大一样即可
+            respBody.put("ErrorCode", orderResult.getRespCode());
+            respBody.put("ErrorInfo", orderResult.getRespMsg());
 
             return respBody;
         }
-        BigDecimal debtMoney = CommonUtils.money(orderResult.getTotalOweAmt());
+        BigDecimal debtMoney = CommonUtils.money(Long.parseLong(orderResult.getRespData().get("customerPayAmount").toString()));
 
         if (chargeMoney.compareTo(debtMoney) != 0) {
             respBody.put("ErrorCode", "DEF0013");
@@ -231,37 +255,42 @@ public class ThirdInvokeServlet extends ERPAdminHttpServlet {
             return respBody;
         }
 
-        GasPeriodCharge customerCharge = new GasPeriodCharge();
-
-        customerCharge.setCustomerId(billKey);
-        customerCharge.setChargeMoney(chargeMoney);
-        customerCharge.setBankSerial(bankBillNo);
-        customerCharge.setBankDate(DateUtil.asDate(payDate, "yyyyMMdd"));
-        customerCharge.setBankDateLong(customerCharge.getBankDate().getTime());
-        //todo 不知道写啥
-//        customerCharge.setPayMode(chargeOrder.getPayMode());
-        customerCharge.setCustomerCount(1);
-
-        ChargeOrderResult chargeResult = gasFeeService.apiChargeFee(customerCharge, gasApp);
-        if (!chargeResult.getErrCode().equals("00000")) {
-            switch (chargeResult.getErrCode()) {
-                case "00003":
-                    respBody.put("ErrorCode", "DEF0001");
-                    respBody.put("ErrorInfo", "无相应记录");
-                    break;
-                case "10001":
-                    respBody.put("ErrorCode", "DEF0005");
-                    respBody.put("ErrorInfo", "超过缴费时间");
-                    break;
-                case "10002":
-                    respBody.put("ErrorCode", "DEF0010");
-                    respBody.put("ErrorInfo", "用户不存在");
-                    break;
-                case "00002":
-                    respBody.put("ErrorCode", "DEF0006");
-                    respBody.put("ErrorInfo", "业务状态异常");
-                    break;
-            }
+//        GasPeriodCharge customerCharge = new GasPeriodCharge();
+//
+//        customerCharge.setCustomerId(billKey);
+//        customerCharge.setChargeMoney(chargeMoney);
+//        customerCharge.setBankSerial(bankBillNo);
+//        customerCharge.setBankDate(DateUtil.asDate(payDate, "yyyyMMdd"));
+//        customerCharge.setBankDateLong(customerCharge.getBankDate().getTime());
+//        //todo 不知道写啥
+////        customerCharge.setPayMode(chargeOrder.getPayMode());
+//        customerCharge.setCustomerCount(1);
+
+        BaseResponse chargeResult = callThirdAppService.callRequestPay(billKey, DateUtil.asDate(payDate, "yyyyMMdd"), bankBillNo,
+                payAmount, heatingApp, DATA_SOURCE_ID, SUPPLIER_CODE).getResult();
+        if (!chargeResult.getRespCode().equals("00000")) {
+//            switch (chargeResult.getErrCode()) {
+//                case "00003":
+//                    respBody.put("ErrorCode", "DEF0001");
+//                    respBody.put("ErrorInfo", "无相应记录");
+//                    break;
+//                case "10001":
+//                    respBody.put("ErrorCode", "DEF0005");
+//                    respBody.put("ErrorInfo", "超过缴费时间");
+//                    break;
+//                case "10002":
+//                    respBody.put("ErrorCode", "DEF0010");
+//                    respBody.put("ErrorInfo", "用户不存在");
+//                    break;
+//                case "00002":
+//                    respBody.put("ErrorCode", "DEF0006");
+//                    respBody.put("ErrorInfo", "业务状态异常");
+//                    break;
+//            }
+
+            //我们自己将错误代码定的和光大一样即可
+            respBody.put("ErrorCode", orderResult.getRespCode());
+            respBody.put("ErrorInfo", orderResult.getRespMsg());
             return respBody;
         } else {
             respBody.put("companyNo", CommonUtils.generateSerialCode());