From 38eed874fc4cf74789d438b78381bd26448ceb3f Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期四, 03 七月 2025 18:50:41 +0800 Subject: [PATCH] 查询所有未处理的安灯信息及查询所有设备 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/board/service/impl/DtBoardServiceImpl.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 6 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 ebea97e..8733dcd 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 @@ -1,18 +1,19 @@ package org.jeecg.modules.board.service.impl; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import liquibase.pro.packaged.I; +import com.baomidou.mybatisplus.core.toolkit.StringPool; import org.apache.commons.lang3.StringUtils; import org.jeecg.common.constant.CommonConstant; +import org.jeecg.common.constant.WebsocketConst; 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.*; import org.jeecg.modules.mdc.util.DateUtils; +import org.jeecg.modules.mdc.vo.AndonOrderWebSocketVo; import org.jeecg.modules.system.entity.MdcProduction; import org.jeecg.modules.system.service.IMdcProductionService; import org.jeecg.modules.system.service.ISysDictService; @@ -70,6 +71,9 @@ @Resource private DtBoardMapper dtBoardMapper; + + @Resource + private IAndonOrderService andonOrderService; /** * 杞﹂棿淇℃伅 @@ -326,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; } @@ -346,8 +350,6 @@ /** * 璁惧鏁呴殰 - * @param productionId - * @return */ @Override public List<EquRepair> equRepairList(String productionId) { @@ -365,4 +367,47 @@ 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; + } + + @Override + public List<AndonOrderWebSocketVo> untreatedAndonList() { + List<AndonOrderWebSocketVo> result = andonOrderService.untreatedAndonList(); + return result; + } + + @Override + public List<EquStatus> getAllEquipmentStatus() { + List<Equipment> equipmentList = equipmentService.list(); + List<EquStatus> equStatusList = new ArrayList<>(); + if (equipmentList != null && !equipmentList.isEmpty()) { + for (Equipment equipment : equipmentList) { + if (equipment.getOporation() == null) { + equipment.setOporation(0); + } + EquStatus equStatus = new EquStatus(); + equStatus.setEquipmentId(equipment.getEquipmentid()); + equStatus.setState(equipment.getOporation()); + // 閫氳繃equipmentId鑾峰彇璁惧杞﹂棿鍚嶇О + String productionName = mdcProductionService.findProName(equipment.getEquipmentid()); + equStatus.setPlantName(StringUtils.isNotBlank(productionName) ? productionName : StringPool.EMPTY); + equStatusList.add(equStatus); + } + } + return equStatusList; + } } -- Gitblit v1.9.3