瀏覽代碼

大屏计算bug修复

wudingsheng 1 周之前
父節點
當前提交
3b8f574763

+ 9 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java

@@ -1959,16 +1959,19 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
                         beforeUseTime=useTimeMap.get(ip);
                     }
 
+                    ToolCostomAddressHistory minTool=null;
                     //获取机床启动程序时间的数据采集
+                    if(beforeUseTime == 0){
+                        minTool = baseMapper.getMinTool(item.getStartTime(),ip);
+                    }else{
+                        Optional<ToolCostomAddressHistory> minFirst = minProduct.stream().filter(it -> it.getIp().equals(ip)).findFirst();
+                        minTool=minFirst.isPresent() ? minFirst.get():null;
+                    }
 
-                    Optional<ToolCostomAddressHistory> minFirst = minProduct.stream().filter(it -> it.getIp().equals(ip)).findFirst();
                     Optional<ToolCostomAddressHistory> first = maxProduct.stream().filter(it -> it.getIp().equals(ip)).findFirst();
 
-
-
-                    if(minFirst.isPresent() && first.isPresent()){
-                        String minValue = minFirst.get().getValue();
-                        cn.hutool.json.JSONObject jsonObject=new cn.hutool.json.JSONObject(minValue);
+                    if(minTool!=null && first.isPresent()){
+                        cn.hutool.json.JSONObject jsonObject=new cn.hutool.json.JSONObject(minTool.getValue());
                         JSONArray minJsonArray = JSONArray.parseArray(jsonObject.get("values").toString());
                         String min = minJsonArray.get(101).toString();