From e935889261ef38c8eaef31e54cbfc466d63d2ef4 Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期四, 17 七月 2025 09:42:28 +0800
Subject: [PATCH] fanuc获取程序名、获取报警描述

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java |   44 ++++++++++++++++++--------------------------
 1 files changed, 18 insertions(+), 26 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java
index 7bbf531..4e6a883 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java
@@ -4,6 +4,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.system.vo.DictModel;
+import org.jeecg.modules.mdc.dto.MdcEquipmentStatisticalDto;
 import org.jeecg.modules.mdc.entity.*;
 import org.jeecg.modules.mdc.mapper.MdcEquipmentStatisticalInfoMapper;
 import org.jeecg.modules.mdc.service.*;
@@ -36,10 +37,7 @@
     private IMdcSystemParametersService mdcSystemParametersService;
 
     @Resource
-    private ISysDictService sysDictService;
-
-    @Resource
-    private IEquipmentStatisticalInfoService equipmentStatisticalInfoService;
+    private IMdcEquipmentFaultInfoService mdcEquipmentFaultInfoService;
 
     /**
      * 璁$畻璁惧鍗曟棩杩愯鏁版嵁
@@ -68,28 +66,8 @@
         }
         if (!result.isEmpty()) {
             this.saveBatch(result);
-            List<DictModel> dictList = sysDictService.queryDictItemsByCode("data_synchronization_flag");
-            if (dictList != null && !dictList.isEmpty() && "0".equals(dictList.get(0).getValue())) {
-                List<EquipmentStatisticalInfo> list = this.dataHandle(result);
-                equipmentStatisticalInfoService.saveBatch(list);
-            }
         }
-    }
-
-    private List<EquipmentStatisticalInfo> dataHandle(List<MdcEquipmentStatisticalInfo> list) {
-        List<EquipmentStatisticalInfo> result = new ArrayList<>();
-        list.forEach(item -> {
-            EquipmentStatisticalInfo equipmentStatisticalInfo = new EquipmentStatisticalInfo();
-            equipmentStatisticalInfo.setEquipment(item.getEquipmentId());
-            equipmentStatisticalInfo.setTheDate(item.getTheDate());
-            equipmentStatisticalInfo.setClosedLong(item.getCloseLong());
-            equipmentStatisticalInfo.setOpeningLong(item.getOpenLong());
-            equipmentStatisticalInfo.setErroringLong(item.getErrorLong());
-            equipmentStatisticalInfo.setProcessingLong(item.getProcessLong());
-            equipmentStatisticalInfo.setWaitingLong(item.getWaitLong());
-            result.add(equipmentStatisticalInfo);
-        });
-        return result;
+        mdcEquipmentFaultInfoService.runningAllEquFaultStatistical(dateTime);
     }
 
     private List<MdcEquipmentStatisticalInfo> equipmentStatisticalProcess(Equipment equipment, String dateTime) {
@@ -140,7 +118,6 @@
                 List<MdcEquipmentRunningSection> equipmentRunningSectionList = mdcEquipmentRunningSectionService.listForEquipmentStatisticalInfo(equipment.getEquipmentid(), startDate, endDate);
                 return this.statisticsData(equipmentRunningSectionList, planTime, startDate, endDate, equipment);
             } else {
-                //寰呴獙璇�
                 Date end = DateUtils.plusTime(initDate, 1);
                 endDate = DateUtils.setTimeForDay(end, planTime);
                 List<MdcEquipmentRunningSection> equipmentRunningSectionList = mdcEquipmentRunningSectionService.listForEquipmentStatisticalInfo(equipment.getEquipmentid(), startDate, endDate);
@@ -317,4 +294,19 @@
             return Integer.parseInt(new BigDecimal(processLong).divide(new BigDecimal("60"), 0, RoundingMode.HALF_UP).toString());
         }
     }
+
+    @Override
+    public MdcEquipmentStatisticalDto findByEquipmentAndMonth(String equipmentId, String date) {
+        return this.baseMapper.findByEquipmentAndMonth(equipmentId, date);
+    }
+
+    @Override
+    public MdcEquipmentStatisticalInfo findByEquIdsAndMonth(List<String> equipmentIdList, String month) {
+        return this.baseMapper.findByEquIdsAndMonth(equipmentIdList, month);
+    }
+
+    @Override
+    public List<MdcEquipmentStatisticalInfo> findByEquipmentAndDate(List<String> equipmentIdList, String date) {
+        return this.baseMapper.findByEquipmentAndDate(equipmentIdList, date);
+    }
 }

--
Gitblit v1.9.3