Просмотр исходного кода

大屏样式改好,提交代码

zyf 2 лет назад
Родитель
Сommit
48462b6ac5

+ 8 - 0
src/main/java/com/steerinfo/dil/feign/LargeScreenFeign.java

@@ -20,4 +20,12 @@ public interface LargeScreenFeign {
     @ResponseBody
     public RESTfulResult showLargeScreenNew(@RequestBody(required = false)List<Map<String,Object>> cars);
 
+    @PostMapping("api/v1/largeScreen/largescreenshow/showLargeScreenForSteelNew1")
+    @ResponseBody
+    public RESTfulResult showLargeScreenForSteelNew1(@RequestBody(required = false) List<Map<String,Object>> cars);
+
+    @PostMapping("api/v1/largeScreen/largescreenshow/showLargeScreenNew1")
+    @ResponseBody
+    public RESTfulResult showLargeScreenNew1(@RequestBody(required = false) List<Map<String,Object>> cars);
+
 }

+ 35 - 10
src/main/java/com/steerinfo/dil/service/impl/QmsQueueListServiceImpl.java

@@ -12,12 +12,14 @@ import com.steerinfo.dil.model.QmsQueueList;
 import com.steerinfo.dil.mapper.QmsQueueListMapper;
 import com.steerinfo.dil.service.IQmsQueueListService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.text.SimpleDateFormat;
 import java.util.*;
 import java.math.BigDecimal;
+import java.util.stream.Collectors;
 
 /**
  * QmsQueueList服务实现:
@@ -47,13 +49,15 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
     @Autowired
     private QueuingRulesMapper  queuingRulesMapper;
 
+    @Autowired
+    QmsQueueResultServiceImpl qmsQueueResultService;
+
     @Autowired
     private QmsQueueSpellingListMapper qmsQueueSpellingListMapper;
 
     @Autowired
     LargeScreenFeign largeScreenFeign;
 
-
     private final SimpleDateFormat gatepostTimeSdf = new SimpleDateFormat("HHmmss");
 
     /**
@@ -355,15 +359,6 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
             qmsQueueSpellingListMapper.updateOOMLoadWarehouse(mesMap);
         }
         queuingRulesService.pushMesToWebsocket(list);
-        //更新大屏(钢材科与东门)
-        try{
-            //展示钢材科大屏
-            largeScreenFeign.showLargeScreenForSteelNew(mapList);
-            //展示东门大屏
-            largeScreenFeign.showLargeScreenNew(mapList);
-        }catch (Exception e){
-            System.out.println("大屏调用异常");
-        }
         return count;
     }
 
@@ -428,6 +423,35 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
         return qmsQueueResultMapper.getQueueListByQueueUpSpelling(map);
     }
 
+    /**
+     * @author:zyf
+     * @version:1.0
+     * @Date:
+     * @Description:做一个定时任务向两块大屏赋予值
+     */
+    @Scheduled(cron = "*/30 * * * * ?")
+    public void sendDataToLargeCreen(){
+        Map<String,Object> mapValue=new HashMap<>();
+        List<Map<String, Object>> datalist =new ArrayList<>();
+        List<Map<String, Object>> queueListByQueueUp = qmsQueueResultService.getQueueListByQueueUp(mapValue);
+        List<Map<String, Object>> queueListByQueueUpSpelling = qmsQueueResultService.getQueueListByQueueUpSpelling(mapValue);
+        HashSet<Map<String,Object>> set=new HashSet<>(queueListByQueueUpSpelling);
+        //queueListByQueueUp=queueListByQueueUp.stream().distinct().collect(Collectors.toList());
+        datalist.addAll(queueListByQueueUp);
+        queueListByQueueUpSpelling=queueListByQueueUpSpelling.stream().distinct().collect(Collectors.toList());
+        datalist.addAll(set);
+        System.out.println(datalist.toString());
+        //更新大屏(钢材科与东门)
+        try{
+            //展示钢材科大屏
+            largeScreenFeign.showLargeScreenForSteelNew1(datalist);
+            //展示东门大屏
+            largeScreenFeign.showLargeScreenNew1(datalist);
+            System.out.println("大屏调用成功");
+        }catch (Exception e){
+            System.out.println("大屏调用异常");
+        }
+    }
 
 //    @Override
 //    public int queueCutInLine(Map<String, Object> map) {
@@ -527,4 +551,5 @@ public class QmsQueueListServiceImpl implements IQmsQueueListService {
 //        }
 //        return listQueueMes;
 //    }
+
 }

+ 6 - 3
src/main/java/com/steerinfo/dil/service/impl/QmsQueueResultServiceImpl.java

@@ -1,5 +1,6 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.controller.QmsQueueResultController;
 import com.steerinfo.dil.feign.IMFeign;
 import com.steerinfo.dil.feign.LargeScreenFeign;
 import com.steerinfo.dil.mapper.QmsQueueListMapper;
@@ -11,7 +12,9 @@ import com.steerinfo.dil.model.QmsQueueResult;
 import com.steerinfo.dil.mapper.QmsQueueResultMapper;
 import com.steerinfo.dil.service.IQmsQueueResultService;
 import com.steerinfo.dil.util.ElectronicFenceUtils;
+import com.steerinfo.framework.controller.RESTfulResult;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import java.util.*;
 import java.math.BigDecimal;
@@ -47,9 +50,6 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
     @Autowired
     private QmsQueueGridServiceImpl qmsQueueGridService;
 
-    /*@Autowired
-    LargeScreenShowController*/
-
     @Autowired
     private QueuingRulesMapper queuingRulesMapper;
 
@@ -222,6 +222,9 @@ public class QmsQueueResultServiceImpl implements IQmsQueueResultService {
         return  qmsQueueResultMapper.getQueueListByQueueUpSpelling(map);
     }
 
+
+
+
     /**
      * 查询排队取消数据
      * @param map