From ec1bf4658e36a17f971a54007920a44c5378b7dc Mon Sep 17 00:00:00 2001
From: cuijian <cuijian@xalxzn.com>
Date: 星期一, 16 六月 2025 10:41:39 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/board/service/impl/DtBoardServiceImpl.java |   49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 48 insertions(+), 1 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/board/service/impl/DtBoardServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/board/service/impl/DtBoardServiceImpl.java
index bf79693..f6fc360 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/board/service/impl/DtBoardServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/board/service/impl/DtBoardServiceImpl.java
@@ -5,8 +5,10 @@
 import org.apache.commons.lang3.StringUtils;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.system.vo.DictModel;
+import org.jeecg.modules.board.mapper.DtBoardMapper;
 import org.jeecg.modules.board.service.IDtBoardService;
 import org.jeecg.modules.board.vo.*;
+import org.jeecg.modules.eam.service.IEamRepairOrderService;
 import org.jeecg.modules.mdc.constant.MdcConstant;
 import org.jeecg.modules.mdc.entity.*;
 import org.jeecg.modules.mdc.service.*;
@@ -14,12 +16,15 @@
 import org.jeecg.modules.system.entity.MdcProduction;
 import org.jeecg.modules.system.service.IMdcProductionService;
 import org.jeecg.modules.system.service.ISysDictService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -63,6 +68,12 @@
 
     @Resource
     private IMdcAlarmInfoService mdcAlarmInfoService;
+
+    @Resource
+    private DtBoardMapper dtBoardMapper;
+
+    @Resource
+    private IAndonOrderService andonOrderService;
 
     /**
      * 杞﹂棿淇℃伅
@@ -319,7 +330,7 @@
         if (equipmentIdList == null || equipmentIdList.isEmpty()) {
             return null;
         }
-        List<EquipmentAlarm> equipmentAlarmList =  equipmentAlarmService.list(new LambdaQueryWrapper<EquipmentAlarm>().in(EquipmentAlarm::getEquipmentid, equipmentIdList).orderByDesc(EquipmentAlarm::getCollecttime).isNotNull(EquipmentAlarm::getAlarmNo).last("TOP 15"));
+        List<EquipmentAlarm> equipmentAlarmList = equipmentAlarmService.equAlarmList(equipmentIdList);
         if (equipmentAlarmList == null || equipmentAlarmList.isEmpty()) {
             return null;
         }
@@ -337,4 +348,40 @@
         return result;
     }
 
+    /**
+     * 璁惧鏁呴殰
+     */
+    @Override
+    public List<EquRepair> equRepairList(String productionId) {
+        List<String> proIds = mdcProductionService.findChildByProId(productionId);
+        if (proIds == null || proIds.isEmpty()) {
+            return null;
+        }
+        List<String> equipmentIdList = mdcEquipmentService.getEquIdsByProIds(proIds);
+        if (equipmentIdList == null || equipmentIdList.isEmpty()) {
+            return null;
+        }
+        LocalDateTime currentDate = LocalDate.now().minusMonths(1).atStartOfDay();
+        String format = currentDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+        List<EquRepair> result = dtBoardMapper.equRepairList(equipmentIdList, format);
+        return result;
+    }
+
+    /**
+     * 璁惧瀹夌伅闂
+     */
+    @Override
+    public List<EquAndon> equAndonList(String productionId) {
+        List<String> proIds = mdcProductionService.findChildByProId(productionId);
+        if (proIds == null || proIds.isEmpty()) {
+            return null;
+        }
+        List<String> equipmentIdList = mdcEquipmentService.getEquIdsByProIds(proIds);
+        if (equipmentIdList == null || equipmentIdList.isEmpty()) {
+            return null;
+        }
+        List<EquAndon> result = andonOrderService.equAndonList(equipmentIdList);
+        return result;
+    }
+
 }

--
Gitblit v1.9.3