浏览代码

大屏展示优化

lxb 1 年之前
父节点
当前提交
c643c7f9b1

+ 23 - 11
src/main/java/com/imcs/admin/common/collection/DeviceCollectionTaskJob.java

@@ -43,7 +43,7 @@ public class DeviceCollectionTaskJob {
      * 设备采集任务FANUC
      * FANUC
      */
-    @Scheduled(cron = "0/5 * * * * *")
+   @Scheduled(cron = "0/10 * * * * *")
     void deviceCollectionTaskFanuc() throws Exception {
         Object fanucObj = this.redisGet("FANUC_COLLECTION");
         this.executorHandle(fanucObj);
@@ -53,7 +53,7 @@ public class DeviceCollectionTaskJob {
      * 设备采集任务Opcua
      * 西门子
      */
-    @Scheduled(cron = "0/5 * * * * *")
+    @Scheduled(cron = "0/10 * * * * *")
     void deviceCollectionTaskOpcua() throws Exception {
         Object opcuaObj = this.redisGet("OPCUA_COLLECTION");
         this.executorHandle(opcuaObj);
@@ -63,7 +63,7 @@ public class DeviceCollectionTaskJob {
      * 设备采集任务Heidenhain
      * 海德汉
      */
-    @Scheduled(cron = "0/5 * * * * *")
+    @Scheduled(cron = "0/10 * * * * *")
     void deviceCollectionTaskHeidenhain() throws Exception {
         Object heidenhainObj = this.redisGet("HEIDENHAIN_COLLECTION");
         this.executorHandle(heidenhainObj);
@@ -73,7 +73,7 @@ public class DeviceCollectionTaskJob {
      * 设备采集任务Mitsubishi
      * 三菱
      */
-    @Scheduled(cron = "0/5 * * * * *")
+    @Scheduled(cron = "0/10 * * * * *")
     void deviceCollectionTaskMitsubishi() throws Exception {
         Object mitsubishiObj = this.redisGet("MITSUBISHI_COLLECTION");
         this.executorHandle(mitsubishiObj);
@@ -83,12 +83,12 @@ public class DeviceCollectionTaskJob {
      * 设备采集任务MtConnect
      * 赫克
      */
-    @Scheduled(cron = "0/5 * * * * *")
+    /*@Scheduled(cron = "0/10 * * * * *")
     void deviceCollectionTaskMtConnect() throws Exception {
         Object mtConnectObj = this.redisGet("MTCONNECT_COLLECTION");
         this.executorHandle(mtConnectObj);
     }
-
+*/
     /**
      * 多线程处理
      */
@@ -104,10 +104,14 @@ public class DeviceCollectionTaskJob {
                     if(returnInfo !=null){
                         JSONObject returnJson = JSONUtil.parseObj(returnInfo);
                         if((boolean)returnJson.get("result")){
-                            this.saveOrUpdateDeviceCollection(returnJson,map.get("serverUrl"));
-                            this.saveOrUpdateDeviceCollectionDetail(returnJson,map.get("serverUrl"));
+                            Object ip = map.get("serverUrl");
+                            if("Opcua".equals(map.get("deviceType").toString())){
+                                ip = map.get("ip");
+                            }
+                            this.saveOrUpdateDeviceCollection(returnJson,ip,map.get("deviceType").toString());
+                            this.saveOrUpdateDeviceCollectionDetail(returnJson,ip);
                             try {
-                                this.deviceCollectionInfoWriteFile(returnJson,map.get("serverUrl"));
+                                this.deviceCollectionInfoWriteFile(returnJson,ip);
                             } catch (IOException e) {
                                 e.printStackTrace();
                             }
@@ -125,10 +129,18 @@ public class DeviceCollectionTaskJob {
      * @param returnJson
      * @param ip
      */
-    public void saveOrUpdateDeviceCollection(JSONObject returnJson,Object ip){
+    public void saveOrUpdateDeviceCollection(JSONObject returnJson,Object ip,String deviceType){
         //组装参数,更新设备采集表
+        Object mainProg = returnJson.get("mainProg");
         JSONObject deviceInfo = new JSONObject();
-        deviceInfo.putOnce("mainProg",returnJson.get("mainProg"));
+        if("Opcua".equals(deviceType) && !Objects.isNull(mainProg)){
+            if(mainProg.toString().contains("/")){
+                String[] split = mainProg.toString().split("/");
+                mainProg = split[split.length - 1];
+            }
+
+        }
+        deviceInfo.putOnce("mainProg",mainProg);
         deviceInfo.putOnce("actFeed",returnJson.get("actFeed"));
         deviceInfo.putOnce("spindleMagnification",returnJson.get("spindleMagnification"));
         deviceInfo.putOnce("actSpindle",returnJson.get("actSpindle"));

+ 2 - 2
src/main/resources/static/admin/bigScreen/index.html

@@ -135,7 +135,7 @@
                                 </tr>
                                 <tr>
                                     <td>主轴转速</td>
-                                    <td>${(device.actSpindle !== null && device.actSpindle !== undefined && device.actSpindle !== 'NaN' && device.actSpindle !== '') ? device.actSpindle + '%' : '0'}</td>
+                                    <td>${(device.actSpindle !== null && device.actSpindle !== undefined && device.actSpindle !== 'NaN' && device.actSpindle !== '') ? device.actSpindle : '0'}</td>
                                 </tr>
                                 <tr>
                                     <td>主轴倍率</td>
@@ -144,7 +144,7 @@
 
                                 <tr>
                                     <td>进给速度</td>
-                                    <td>${(device.actFeed !== null && device.actFeed !== undefined && device.actFeed !== 'NaN' && device.actFeed !== '') ? device.actFeed + '%' : '0'}</td>
+                                    <td>${(device.actFeed !== null && device.actFeed !== undefined && device.actFeed !== 'NaN' && device.actFeed !== '') ? device.actFeed : '0'}</td>
                                 </tr>
                                 </tbody>
                             </table>

+ 1 - 1
src/main/resources/static/admin/bigScreenDetail/index.html

@@ -57,7 +57,7 @@
             <table class="t_table">
                 <thead>
                 <tr>
-                    <th>主轴进给率</th>
+                    <th>进给速度</th>
                     <th>主轴倍率</th>
                     <th>主轴转速</th>
                     <th>开机总时长</th>