From 997e697edaf59893248bc2467223058b221a4de2 Mon Sep 17 00:00:00 2001
From: cl <418351270@qq.com>
Date: 星期五, 12 七月 2024 14:51:47 +0800
Subject: [PATCH] 修改参数采集

---
 jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java |   36 +++++++++++++++++++++++++++++++++---
 1 files changed, 33 insertions(+), 3 deletions(-)

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 2383d39..12dc6e2 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
@@ -123,7 +123,7 @@
                         if (ObjectUtil.isNotNull(value1)){
                             String cellCode = value1.toString();
                             //鍙嶉鐢佃姱ocv妫�娴嬬粨鏋�
-                            boolean b = OCVResultFeedBack(thoroughfare, device,cellCode);
+                            boolean b = OCVResultFeedBack(thoroughfare, device,cellCode);//瀵规浛鎹㈢數鑺牎楠�
                             //鍥涗釜鐢佃姱鐨勭姸鎬�
                             if (b){
                                 scanResult = 11;
@@ -146,7 +146,7 @@
                     //1:鍛婄煡MES鎵樼洏宸插埌绔欙紝璇锋眰涓嬪彂杩涚珯鐘舵��
                     if (Constants.OP030.equals(device)){
                         //鍙嶉鐢佃姱ocv妫�娴嬬粨鏋�
-                        boolean b = OCVResultFeedBack(thoroughfare, device);
+                        boolean b = OCVResultFeedBack(thoroughfare, device);//杩涚珯瀵�4涓數鑺牎楠�
                         //鍥涗釜鐢佃姱鐨勭姸鎬�
                         if (b){
                             miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(11).build());
@@ -504,13 +504,19 @@
                 CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                     //鎻掑叆鍙傛暟閲囬泦琛�
                     daParamCollectionService.insertBatch(collectionList);
+
+                    //濡傛灉220宸ヤ綅锛岃繘琛屾姤宸�
+                    if("M1OP220".equals(device)) {
+                        RestfulService.getWorkReportResultFeedback(moduleCode, "M1OP220", format.format(new Date()));
+                    }
+
                     //涓婁紶鍒板伐鍘俶es
                     ParentVO parentVO = new ParentVO();
                     parentVO.setStationCode(device);//宸ヤ綅
                     parentVO.setSiteCode("3983");
 
                     parentVO.setRecordId(UUID.randomUUID().toString());
-                    if("2".equals(stationStatus)){
+                    if("2".equals(stationStatus)){//宸ョ珯鐘舵��
                         parentVO.setTotalResult("0");
                     }else {
                         parentVO.setTotalResult("1");
@@ -898,5 +904,29 @@
         return flag;
     }
 
+    /**
+     * AMES鎶ュ伐缁撴灉鍥炰紶
+     * @param productNum
+     * @param stationCode
+     * @param confirmTime
+     * @return
+     */
+    //{"code":"success","data":{"productNum":"LCV123456P0600036","stationCode":"1HZ01","resultCode":"S","resultText":"鎶ュ伐鎴愬姛"},"message":"API璋冪敤鎴愬姛"}
+    public static String getWorkReportResultFeedback(String productNum,String stationCode,String confirmTime)
+    {
+        String result = "";
+        try {
+            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();
+        }catch (Exception e){
+            e.printStackTrace();
+        }finally {
+            return result;
+        }
+
+    }
+
 
 }

--
Gitblit v1.9.3