From 971788bf15d4bd58fe5bb6dbb76f16317a25ef7b Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期五, 12 七月 2024 09:02:14 +0800
Subject: [PATCH] 工厂MES接口地址优化

---
 jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java                    |   17 --------
 jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java                    |   31 ++-------------
 jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java |    8 +---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java                              |    4 +-
 jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java                                           |    5 ++
 5 files changed, 14 insertions(+), 51 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java b/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java
index d646279..8a0b392 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/constant/Constants.java
@@ -59,6 +59,9 @@
     public static final Integer INT_THREE= 3;
     public static final Integer INT_FOUR= 4;
     public static final Integer INT_ZERO= 0;
-    public static final String FACTORY_EMS_UAT_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/";
+    public static final String FACTORY_EMS_UAT_GET_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/";
+    public static final String FACTORY_EMS_UAT_POST_RUL = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface/";
+    public static final String FACTORY_EMS_SITE_CODE = "3983";
+
 
 }
diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
index db13317..9c63980 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -536,8 +536,6 @@
     public void pushGeelycvMesFeedback(String packID, String stationCode) {
         logger.info("杩涘叆浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID);
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
-//        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
         String totalResult = "0";
         List<DaParamCollectionTemp> paramList = daParamCollectionTempService.list(new LambdaQueryWrapper<DaParamCollectionTemp>().eq(DaParamCollectionTemp::getSfcCode, packID).eq(DaParamCollectionTemp::getLocationCode, stationCode));
         if(paramList.size() > 0){
@@ -592,7 +590,7 @@
             try{
                 CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                     logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
-                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
+                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                     logger.info("寮傛鏂规硶鎵ц缁撴潫");
                     logger.info("鎵嬪姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶{}"+execute.body());
 
@@ -622,8 +620,6 @@
     public void automaticWorkstationPushGeelycvMesFeedback(String packID, String stationCode,List<DaParamCollection> paramList) {
         logger.info("杩涘叆宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉昦utomaticWorkstationPushGeelycvMesFeedback",stationCode);
         SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
-//        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
         String totalResult = "0";
         if(paramList.size() > 0){
             logger.info("杩涘叆宸ヤ綅{}-鎷兼暟鎹�",stationCode);
@@ -679,7 +675,7 @@
             try{
                 CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                     logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
-                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
+                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                     System.out.println(execute.body());
                     logger.info("寮傛鏂规硶鎵ц缁撴潫");
                     logger.info("鑷姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶{}"+execute.body());
diff --git a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
index 54057d2..85eec3c 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -518,7 +518,7 @@
                     parentVO.setCheckList(mesList);
 
                     log.info("鎵ц宸ュ巶MES鏂规硶start锛屽伐浣嶅彿{} 浼犲叆鏁版嵁锛歿}",device ,parentVO);
-                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
+                    HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                     log.info("鎵ц宸ュ巶MES鏂规硶end锛屽伐浣嶅彿{} 杩斿洖鏁版嵁锛歿}",device,execute.body());
 
                 });
@@ -758,7 +758,7 @@
                             parentVO.setCheckList(mesChildList);//鍙傛暟
                             //CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                             log.info("鎵ц宸ュ巶MES鏂规硶start锛屼紶鍏ユ暟鎹細{}",parentVO);
-                            HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
+                            HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
                             log.info("鎵ц宸ュ巶MES鏂规硶end锛岃繑鍥炴暟鎹細{}",execute.body());
                         }
                     }
diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java b/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java
index 09b55c4..473e535 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/restful/factoryMes/service/RestfulService.java
@@ -8,27 +8,6 @@
 import org.springframework.web.bind.annotation.RequestParam;
 
 public class RestfulService {
-    public static void main(String[] args) {
-        String json = "{\"code\":\"success\",\"data\":{\"productNum\":\"LCV123456P0600036\",\"stationCode\":\"1HZ01\",\"resultCode\":\"S\",\"resultText\":\"鎶ュ伐鎴愬姛\"},\"message\":\"API 璋冪敤鎴愬姛\"}";
-        JSONObject jsonObject = new JSONObject(json);
-        String code = jsonObject.getStr("code");
-        String resultCode = jsonObject.getJSONObject("data").getStr("resultCode");
-        System.out.println("code: " + code);
-        System.out.println("resultCode: " + resultCode);
-    }
-
-    public static final String getRealmName = Constants.FACTORY_EMS_UAT_RUL;
-
-    //    public static final String getRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration";
-//
-    public static final String postRealmName = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/interface";
-
-//    public static final String getRealmName = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration";
-
-//    public static final String postRealmName = "https://imes-group.geelycv.com/api/mom-open/restful/interface";
-
-    public static final String siteCode = "3983";
-
     /**
      * 鐢熶骇宸ュ崟璇锋眰鎺ュ彛
      * @param productNum
@@ -38,7 +17,7 @@
     //{"code":"success","data":{"productNum":"LCV123456P0600036","stationCode":"1HZ01","materialCode":"LCV001_3","productionOrderNum":"500000258"},"message":"API璋冪敤鎴愬姛"}
     public static String getProductionWorkOrderRequest(String productNum,String stationCode,String materialCode)
     {
-        String url = getRealmName + "/productionWorkOrderRequest?siteCode="+siteCode+"&stationCode="+stationCode+"&productNum="+productNum+"&materialCode="+materialCode;
+        String url = Constants.FACTORY_EMS_UAT_GET_RUL + "productionWorkOrderRequest?siteCode="+Constants.FACTORY_EMS_SITE_CODE+"&stationCode="+stationCode+"&productNum="+productNum+"&materialCode="+materialCode;
         HttpResponse response = HttpRequest.get(url).execute();
         HttpRequest httpRequest = HttpRequest.get(url);
         return response.body();
@@ -56,7 +35,7 @@
     {
         String result = "";
         try {
-            String url = getRealmName + "/workReportResultFeedback?siteCode="+siteCode+"&stationCode="+stationCode+"&productNum="+productNum+"&confirmTime="+confirmTime;
+            String url = Constants.FACTORY_EMS_UAT_GET_RUL + "workReportResultFeedback?siteCode="+Constants.FACTORY_EMS_SITE_CODE+"&stationCode="+stationCode+"&productNum="+productNum+"&confirmTime="+confirmTime;
             HttpResponse response = HttpRequest.get(url).execute();
             HttpRequest httpRequest = HttpRequest.get(url);
             result =  response.body();
@@ -78,7 +57,7 @@
     //{"code":"success","data":[{"productionOrderNum":"500000258","componentCode":"LCV_TZ_002","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_001","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_002","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_003","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_004","quantity":"1.0","stationCode":"C01"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_005","quantity":"1.0","stationCode":"C02"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_006","quantity":"1.0","stationCode":"C03"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_007","quantity":"1.0","stationCode":"C04"},{"productionOrderNum":"500000258","componentCode":"LCV_CG_009","quantity":"2.0","stationCode":"C05"}],"message":"API璋冪敤鎴愬姛"}
     public static String getProductionOrderComponentRequest(String productionOrderNum)
     {
-        String url = getRealmName + "/productionOrderComponentRequest?siteCode="+siteCode+"&productionOrderNum="+productionOrderNum;
+        String url = Constants.FACTORY_EMS_UAT_GET_RUL + "productionOrderComponentRequest?siteCode="+Constants.FACTORY_EMS_SITE_CODE+"&productionOrderNum="+productionOrderNum;
         HttpResponse response = HttpRequest.get(url).execute();
         HttpRequest httpRequest = HttpRequest.get(url);
         return response.body();
@@ -93,10 +72,10 @@
     //{"code":"success","data":[{"configValues":{"FXPTX":"","ZJTX":"","JSYZYZC":"","CDGDTX":"","CHLXTX":""},"productTrackInfo":{"ProductNum":"LCVLCVTS3P0600388","StationCode":"1A03"}}],"message":"API璋冪敤鎴愬姛"}
     public static String postPRODUCTION_QUEUE(String productNum,String stationCode)
     {
-        String url = postRealmName + "/PRODUCTION_QUEUE";
+        String url = Constants.FACTORY_EMS_UAT_POST_RUL + "PRODUCTION_QUEUE";
         HttpResponse response = HttpRequest.post(url)
                 // 琛ㄥ崟鍙傛暟锛屽彲浠ラ�氳繃澶氭璋冪敤 form 鏂规硶娣诲姞澶氫釜鍙傛暟
-                .form("siteCode", siteCode)
+                .form("siteCode", Constants.FACTORY_EMS_SITE_CODE)
                 .form("interfaceCode", "PRODUCTION_QUEUE")
                 .form("parameter", "{\"productNum\":\""+productNum+"\",\"stationCode\":\""+stationCode+"\",\"requestQty\":1}")
                 // 鎵ц璇锋眰
diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
index 70052fe..01f3dad 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
@@ -72,21 +72,6 @@
 
     @Autowired
     private IDaTestDeviceInterfaceTempService daTestDeviceInterfaceTempService;
-    String url = Constants.FACTORY_EMS_UAT_RUL+"deviceResultFeedback";
-
-//    String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
-
-//    String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
-
-    /**
-     * 20宸ヤ綅鎺ユ敹娓呯爺鏁版嵁
-     */
-    @PostMapping("/receiveOVCDataFrom020Workstations")
-    public AjaxResult receiveOVCDataFrom020Workstations(@RequestBody ParentVO parentVO)
-    {
-
-        return AjaxResult.success(null);
-    }
 
     /**
      * 瀵煎嚭鐐规浠诲姟鍒楄〃
@@ -106,7 +91,7 @@
         if(parentVO.getStationCode().equals("M1OP020")){
             this.saveDaTestDeviceInterfaceTemp(parentVO,checkList);
         }
-        HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+        HttpResponse execute = HttpRequest.post(Constants.FACTORY_EMS_UAT_GET_RUL+"deviceResultFeedback").body(JSONUtil.toJsonStr(parentVO)).execute();
         return AjaxResult.success(execute.body());
     }
 

--
Gitblit v1.9.3