Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

Jxing 6 lat temu
rodzic
commit
06eba8812b

+ 2 - 2
pom.xml

@@ -144,11 +144,11 @@
             <version>2.4</version>
         </dependency>
         <!-- https://mvnrepository.com/artifact/org.json/json -->
-        <dependency>
+<!--        <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
             <version>20180130</version>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>

+ 3 - 0
src/main/java/com/sagacloud/route/Route.java

@@ -67,6 +67,9 @@ public class Route extends RouteBuilder {
                 .produces(MediaType.APPLICATION_JSON)
                 .route()
                 .process();
+
+//        from("direct:getPropertiesByPj")
+
     }
 
     protected void configExceptionHandler(){

+ 6 - 8
src/main/java/com/sagacloud/utils/VendersUtil.java

@@ -1,9 +1,8 @@
 package com.sagacloud.utils;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.json.JSONArray;
-import org.json.JSONObject;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 
 import java.util.List;
 
@@ -19,11 +18,10 @@ public class VendersUtil {
         return jsonObj;
     }
 
-    public static JSONObject successJsonMsg(String msg, Object pojo) throws JsonProcessingException {
+    public static JSONObject successJsonMsg(String msg, Object pojo){
         JSONObject obj = new JSONObject();
         if(pojo != null){
-            ObjectMapper mapper = new ObjectMapper();
-            obj = new JSONObject(mapper.writeValueAsString(pojo));
+            obj = (JSONObject) JSONObject.toJSON(pojo);
         }
         JSONObject jsonObj = new JSONObject();
         jsonObj.put("result", "success");
@@ -43,7 +41,7 @@ public class VendersUtil {
     public static JSONObject successJsonMsg(String msg, JSONArray arr){
         JSONObject jsonObj = new JSONObject();
         jsonObj.put("result", "success");
-        jsonObj.put("count",arr.length());
+        jsonObj.put("count",arr.size());
         jsonObj.put("content",arr);
         jsonObj.put("resultMsg", msg);
         return jsonObj;

BIN
target/classes/com/sagacloud/cache/ProPasCache.class


BIN
target/classes/com/sagacloud/listener/VendersDpCamelContextInitialListener.class


BIN
target/classes/com/sagacloud/route/InitEnvRoute.class


+ 2 - 0
target/classes/config.properties

@@ -1,2 +1,4 @@
 dataPlatform.baseUrl=http://192.168.20.225:8080/data-platform-3
+#venders.baseUrl=http://192.168.20.225:8080/venders
+venders.baseUrl=http://101.201.234.108:28888/venders
 

+ 196 - 0
target/classes/documentation.md

@@ -0,0 +1,196 @@
+#生产商
+##查询项目下的资产[辅助服务接口]
+    http://<host>:<port>/venders-dp/manufacturer/property/query  
+post体:
+    
+    {
+        "venderId":"",      //必填,厂商id
+        "projectId":""      //必填,项目id
+    }  
+    
+返回:
+
+    {
+        "result":"success",
+        "resultMsg":"",
+        "content":[
+            {
+                "propertyId":"",                // 资产id
+                "EquipLocalName":"",            // 本地名称
+                "EquipLocalId":"",              // 本地编码
+                "brand":"",                     // 品牌
+                "product":"",                   // 产品名
+                "specification":"",             // 型号
+                "picture":"",                   // 正面照名称,根据名称去图片服务中获取
+                "platePic":"",                  // 名牌照片名称,同正面照
+                "productionDate":"",            // 生产日期
+                "serialNumber":""               // 出厂编号
+            }
+        ]        
+    }    
+
+#供应商
+##查询项目下的资产[辅助服务接口]
+    http://<host>:<port>/venders-dp/supplier/property/query    
+post体:
+    
+    {
+        "venderId":"",              // String, 必填, 维修商Id
+        "projectId":""              // String, 必填, 项目id  
+    } 
+返回:
+
+    {
+        "result":"success",
+        "resultMsg":"",
+        "content":[
+            {
+                "propertyId":"",                // 资产id
+                "EquipLocalName":"",            // 本地名称
+                "EquipLocalId":"",              // 本地编码
+                "brand":"",                     // 品牌
+                "product":"",                   // 产品名
+                "specification":"",             // 型号
+                "price":"",                     // 采购价格
+                "warranty":"",                  // 保修期
+                "productionDate":"",            // 生产日期
+                "serial number":"",             // 出厂编号
+                "contractId":""                 // 合同编号
+            }
+        ]
+    }
+    
+    {
+        "result":"failure",
+        "resultMsg":"***"
+    }             
+
+#保险商
+##获取在保资产清单[辅助服务接口]
+    http://<host>:<port>/venders-dp/insurance/project/query     
+post体:
+    
+    {
+        "vendorId":"",               //String,必填,保险商Id
+        "projectId":""               // String 必填, 数据平台项目id
+    }
+    
+返回:
+
+    {
+        "result":"success",
+        "resultMsg":"",
+        "content":[
+            {
+                "id":"**********",       // 该资产在数据平台的id
+                "infos":{
+                    "EquipLocalName":"***",                   // 本地名称(信息点均为数据平台资产的信息点)
+                    "********":"*****",          // 
+                    ......
+                }
+            },.......        
+        ]
+    }
+    
+    {
+        "result":"failure",
+        "resultMsg":"***"
+    }
+##获取所有保单列表[辅助服务接口]
+    http://<host>:<port>/venders-dp/insurance/contract/query     
+post体:
+    
+    {
+        "vendorId":"",               //String,必填,保险商Id
+        "projectId":""               //String, 必填, 项目id
+    }
+    
+返回:
+
+    {
+        "result":"success",
+        "resultMsg":"",
+        "content":[
+            {
+                "insuranceNo":"***",                   // 保单Id
+                "expireDate":"*****",          // 截止日期
+                "propertyCount":10,              // 保单内资产数量
+                "insuranceFile":"****"           // 保险文件key
+            },.......        
+        ]
+    }
+    
+    {
+        "result":"failure",
+        "resultMsg":"***"
+    }
+
+##根据保单获取资产[辅助服务接口]
+    http://<host>:<port>/venders-dp/insurance/contract/property/query     
+post体:
+    
+    {
+        "venderId":"",             //String,必填,保险商Id
+        "insuranceNo":"",              //String,必填,保单编号
+    }
+    
+返回:
+
+    {
+        "result":"success",
+        "resultMsg":"",
+        "content":[
+            {
+                "id":"****",         // 资产的id
+                "infos":{            // 信息点
+                    "EquipLocalName":"",        // 资产本地名称
+                    "EquipLocalId":"",          // 资产本地编码
+                    "Brand":"",                 // 品牌
+                    "Product":"",               // 产品名
+                    "Specification":"",         // 型号
+                }
+            },......
+        ]
+    }   
+    
+    {
+        "result":"failure",
+        "resultMsg":"***"
+    }
+    
+#维修商
+##查询指定项目内合同有效期内的资产/查询指定项目内历史维护资产[辅助服务接口]
+    http://<host>:<port>/venders-dp/maintainance/property/query
+post体:
+    
+    {
+        "venderId":"****",             // String, 必填, 维修商Id
+        "projectId":"*****",          // String, 必填, 项目id
+        "expire":true                   //Boolean, 必填. true 查询维护合同过期资产, false 查询在维护期的资产
+    }
+    
+返回:
+
+    {
+        "result":"success",
+        "resultMsg":"",
+        "content":[
+            {
+                "id":"****",                 //资产id
+                "infos":{
+                    "EquipLocalName":"",               // 本地名称
+                    "EquipLocalId":"",               // 本地编码
+                    "Brand":"",                   // 品牌
+                    "Product":"",                 // 标牌名
+                    "Specification":"",           // 型号
+                    "MaintainDeadline":"",              // 合同截止日期
+                    "MaintainPeriod":100                   // 保养周期
+                }
+            },........
+        ]
+    }
+    
+    {
+        "result":"failure",
+        "resultMsg":"***"
+    }