From d76bbaa8a9a70124045dc4c9753e5a868ac4e7d2 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期五, 21 六月 2024 09:33:38 +0800
Subject: [PATCH] -

---
 jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java                              |    1 
 jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java                    |   31 ++++++++++
 jcdm-ui/src/views/main/om/productionOrde/index.vue                                                      |   20 +++---
 jcdm-ui/src/views/main/cfkb/Instructions/index.vue                                                      |   22 +++---
 jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java |   52 ++++++++++++++--
 5 files changed, 96 insertions(+), 30 deletions(-)

diff --git a/jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java b/jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java
index 3e24f7f..0ec0164 100644
--- a/jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java
+++ b/jcdm-framework/src/main/java/com/jcdm/framework/config/SecurityConfig.java
@@ -119,6 +119,7 @@
                 .antMatchers("/jcdmMes/**").permitAll()
                 .antMatchers("/da/testDeviceInterface/**").permitAll()
                 .antMatchers("/main/paramCollection/**").permitAll()
+                .antMatchers("/bs/formulaChild/**").permitAll()
                 // 闄や笂闈㈠鐨勬墍鏈夎姹傚叏閮ㄩ渶瑕侀壌鏉冭璇�
                 .anyRequest().authenticated()
                 .and()
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 8705ccc..e84ac6a 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
@@ -50,6 +50,7 @@
 import java.text.SimpleDateFormat;
 import java.time.Instant;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
 
 /**
@@ -245,6 +246,7 @@
                 daParamCollectionTemp.setCollectionTime(new Date());
                 daParamCollectionTemp.setSfcCode(daParamCollection.getProductBarcode());
                 daParamCollectionTemp.setLocationCode(daParamCollection.getLocationCode());
+                daParamCollectionTemp.setProductCode(daParamCollection.getProductCode());
                 daParamCollectionTempService.save(daParamCollectionTemp);
             }
         }
@@ -462,6 +464,7 @@
 
     @Override
     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";
@@ -516,12 +519,25 @@
 
             }
             parentVO.setCheckList(listChildVo);
-            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
-            List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList());
-            Long[] array = idsList.toArray(new Long[0]);
-            daParamCollectionTempService.deleteDaParamCollectionTempByIds(array);
-            System.out.println(execute.body());
+            try{
+                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+                    logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
+                    HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+                    logger.info("寮傛鏂规硶鎵ц缁撴潫");
+                    logger.info("鎵嬪姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶{}"+execute.body());
+                    List<Long> idsList = paramList.stream().map(DaParamCollectionTemp::getId).collect(Collectors.toList());
+                    Long[] array = idsList.toArray(new Long[0]);
+                    int i = daParamCollectionTempService.deleteDaParamCollectionTempByIds(array);
+                    logger.info("鍒犻櫎涓存椂琛ㄦ暟鎹潯鏁皗}-宸ヤ綅{}-pack鐮亄}",i,stationCode,packID);
+                });
+            }catch (Exception e){
+                System.out.println(e.getMessage());
+            }
+//            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+
+//            System.out.println(execute.body());
             System.out.println("-----------------------"+totalResult);
+            logger.info("缁撴潫浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID);
         }
 
     }
@@ -584,9 +600,19 @@
             parentVO.setCheckList(listChildVo);
             logger.info("缁撴潫宸ヤ綅{}-鎷兼暟鎹�",stationCode);
             logger.info("杩涘叆宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉旽ttpResponseSend",stationCode);
-            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+            try{
+                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+                    logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
+                    HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+                    System.out.println(execute.body());
+                    logger.info("寮傛鏂规硶鎵ц缁撴潫");
+                    logger.info("鑷姩宸ヤ綅浼犲伐鍘侻ES寮傛鏂规硶{}"+execute.body());
+                });
+            }catch (Exception e){
+                System.out.println(e.getMessage());
+            }
+//            HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
             logger.info("缁撴潫宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉旽ttpResponseSend",stationCode);
-            System.out.println(execute.body());
             System.out.println("-----------------------"+totalResult);
         }
         logger.info("缁撴潫宸ヤ綅{}-宸ュ巶MES鎺ㄩ�佹暟鎹柟娉昦utomaticWorkstationPushGeelycvMesFeedback",stationCode);
@@ -636,8 +662,18 @@
         parentVO.setTotalResult("1");
         parentVO.setCheckList(childVOList);
         HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+//        try{
+//            CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+//                logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
+//                HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+//                System.out.println(execute.body());
+//                logger.info("寮傛鏂规硶鎵ц缁撴潫");
+//                logger.info("绉伴噸寮傛鏂规硶{}",execute.body());
+//            });
+//        }catch (Exception e){
+//            System.out.println(e.getMessage());
+//        }
         RestfulService.getWorkReportResultFeedback(daParamCollection.getSfcCode(),"OP500",format.format(new Date()));
-        System.out.println(execute.body());
     }
 
 }
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 428775a..a77555f 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
@@ -11,6 +11,7 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jcdm.common.core.domain.AjaxResult;
 import com.jcdm.common.utils.StringUtils;
+import com.jcdm.framework.websocket.WebSocketUsers;
 import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo;
 import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService;
 import com.jcdm.main.constant.Constants;
@@ -23,20 +24,29 @@
 import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
 import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
 import com.jcdm.main.restful.qingYan.doman.*;
+import lombok.extern.slf4j.Slf4j;
 import org.aspectj.weaver.loadtime.Aj;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
+import javax.websocket.Session;
 import java.lang.reflect.Field;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.concurrent.CompletableFuture;
 import java.util.stream.Collectors;
-
+@Slf4j
 @RestController
 @RequestMapping("/jcdmMes")
 public class ExternalInterface {
+    Map<String, Session> map = WebSocketUsers.getUsers();
+
+    private static final Logger logger = LoggerFactory.getLogger("sys-user");
+
     public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     @Autowired
@@ -158,11 +168,22 @@
             if(StringUtils.isNotBlank(parentVO.getProductNum())){
                 OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, parentVO.getProductNum()));
                 if(ObjectUtil.isNotNull(one)){
+                    logger.info("瑙g粦灏忚溅{}锛宲ack鐮佹槸{}"+one.getTrolleyYard(),one.getProductNum());
                     one.setTrolleyYard("");
                     omProductionOrdeInfoService.saveOrUpdate(one);
                 }
             }
         }
+//        try{
+//            CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+//                logger.info("寮�濮嬫墽琛屽紓姝ユ柟娉�");
+//                HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+//                logger.info("寮傛鏂规硶鎵ц缁撴潫");
+//                logger.info("鎺ユ敹娓呯爺锛屾皵瀵嗗紓姝ユ柟娉晎}"+execute.body());
+//            });
+//        }catch (Exception e){
+//            System.out.println(e.getMessage());
+//        }
         HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
         return AjaxResult.success(execute.body());
     }
@@ -244,6 +265,14 @@
 
     }
 
+    /**
+     * 鏀捐璇风┖鐘舵��
+     */
+    @PostMapping("/sendWebSocket")
+    public void sendWebSocket(@RequestBody BsFormulaChildInfo bsFormulaChildInfo)
+    {
+        WebSocketUsers.sendMessageToUserByText(map.get(bsFormulaChildInfo.getLocationCode()), bsFormulaChildInfo.getResults());
+    }
 
     /**
      * 浣跨敤鍙嶅皠鑾峰彇瀵硅薄鐨勫睘鎬у��
diff --git a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
index 392992f..2f02ed9 100644
--- a/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
+++ b/jcdm-ui/src/views/main/cfkb/Instructions/index.vue
@@ -31,26 +31,26 @@
               <div>
                 <div style="display: none" id="printMe">
                   <br>
-                  <p style="margin-left: 25px">9900166410</p>
-                  <p style="margin-left: 25px">HW001.001</p>
-                  <p style="margin-left: 25px">SW002.005</p>
+                  <p style="margin-left: 43px">9900166410</p>
+                  <p style="margin-left: 43px">HW001.001</p>
+                  <p style="margin-left: 43px">SW002.005</p>
                   <br>
-                  <span style="font-size: 30px;font-weight: bold;margin-left: 25px;">GEELY</span><br>
-                  <span style="font-size: 10px;margin-left: 14px">COMMERCIAL VEHICLE</span><br>
-                  <span style="margin-left: 44px">H2155D</span><br>
-                  <span style="margin-left: 44px">993083</span><br>
-                  <span style="margin-left: 26px">9900166410</span><br>
-                  <span style="font-size: 10px;margin-right: 10px">{{text1}}</span>
+                  <span style="font-size: 30px;font-weight: bold;margin-left: 40px;">GEELY</span><br>
+                  <span style="font-size: 10px;margin-left: 29px">COMMERCIAL VEHICLE</span><br>
+                  <span style="margin-left: 60px">H2155D</span><br>
+                  <span style="margin-left: 63px">993083</span><br>
+                  <span style="margin-left: 40px">9900166410</span><br>
+                  <span style="font-size: 10px;margin-left: 17px;">{{text1}}</span>
                   <br>
                   <br>
                   <br>
                   <br>
                   <div ref="canvasWrapper" id="canvasWrapper1" style="display: flex;justify-content: center;margin-top: -27px"></div>
-                  <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>
+                  <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>
                   <br>
                   <br>
                   <div ref="canvasWrapper" id="canvasWrapper2" style="display: flex;justify-content: center;margin-top: -27px"></div>
-                  <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>
+                  <span style="font-size: 10px;word-break: break-all;display: flex;justify-content: center;width: 155px;margin-left: 9px">P9900166410#T{{text1}}#V993983#SSW002.005#HHW001.001#NBMS#</span>
                 </div>
                 <el-button @click="print1">鎵撳嵃</el-button>
                 <el-button style="display: none" @click="test1">鐢熸垚浜岀淮鐮�</el-button>
diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue
index f40770e..6d25ebd 100644
--- a/jcdm-ui/src/views/main/om/productionOrde/index.vue
+++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -147,16 +147,16 @@
           @click="patchwork"
         >琛ユ墦</el-button>
       </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          :disabled="single"
-          @click="jieBang"
-        >瑙g粦</el-button>
-      </el-col>
+<!--      <el-col :span="1.5">-->
+<!--        <el-button-->
+<!--          type="warning"-->
+<!--          plain-->
+<!--          icon="el-icon-download"-->
+<!--          size="mini"-->
+<!--          :disabled="single"-->
+<!--          @click="jieBang"-->
+<!--        >瑙g粦</el-button>-->
+<!--      </el-col>-->
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 

--
Gitblit v1.9.3