From abf0df941bc5e1b77420234b0b3a33e515e390a3 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期四, 29 二月 2024 11:38:55 +0800 Subject: [PATCH] 设备日志关联报警号报警内容 --- lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java | 42 +++++++++++++++++++++++++++++++++++++++++- 1 files changed, 41 insertions(+), 1 deletions(-) diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java index a0fb120..9648ae1 100644 --- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java +++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java @@ -87,6 +87,9 @@ @Resource private ISysBaseAPI sysBaseApi; + @Resource + private IMdcAlarmInfoService mdcAlarmInfoService; + @Override public Map<String, String> getDepNamesByEquipmentIds(List<String> equipmentIds) { @@ -369,7 +372,8 @@ mdcEquipmentDto.setDataFlag(Integer.parseInt(CommonConstant.STATUS_1)); ControlSystem controlSystem = controlSystemService.getByDriveType(mdcEquipmentDto.getDriveType()); // 鏌ヨ璁惧鐘舵�� - Integer oporation = equipmentLogService.selectEquipmentOporation(mdcEquipment.getEquipmentId()); + EquipmentLog equipmentLog = equipmentLogService.selectEquipmentOporation(mdcEquipment.getEquipmentId()); + Integer oporation = equipmentLog.getOporation(); if (controlSystem != null) { //鑾峰彇宸ヤ綔鏁版嵁骞跺垵濮嬪寲 @@ -439,6 +443,21 @@ value = String.valueOf(mdcTorqueConfig.getTorqueValue()); } else { value = "0"; + } + } else if ("alarm".equals(englishName)) { + if (oporation == 22) { + value = equipmentLog.getAlarm(); + } else { + value = "鏃�"; + } + } else if ("alarmContent".equals(englishName)) { + if (oporation == 22) { + List<MdcAlarmInfo> mdcAlarmInfo = mdcAlarmInfoService.list(new LambdaQueryWrapper<MdcAlarmInfo>().eq(MdcAlarmInfo::getDriveType, mdcEquipment.getDriveType()).eq(MdcAlarmInfo::getAlarmCode, equipmentLog.getAlarm()).eq(MdcAlarmInfo::getIsUse, 0)); + if (mdcAlarmInfo != null && !mdcAlarmInfo.isEmpty()) { + value = mdcAlarmInfo.get(0).getAlarmContent(); + } + } else { + value = "鏃�"; } } else { value = result == null ? null : result.toString(); @@ -707,6 +726,11 @@ @Override public IPage<MdcEquipment> pageList(Page<MdcEquipment> page, MdcEquipmentVo mdcEquipment, HttpServletRequest req) { + if (StringUtils.isNotBlank(mdcEquipment.getProductionName())) { + // 閫掑綊鏌ヨ鎵�鏈夊瓙鑺傜偣 + List<String> productionIds = mdcProductionService.recursionChildren(mdcEquipment.getProductionName()); + mdcEquipment.setProductionIds(productionIds); + } return this.baseMapper.pageList(page, mdcEquipment); } @@ -766,4 +790,20 @@ } + /** + * 瀵煎嚭list + * + * @param mdcEquipment + * @return + */ + @Override + public List<MdcEquipment> exportXlsList(MdcEquipmentVo mdcEquipment) { + if (StringUtils.isNotBlank(mdcEquipment.getProductionName())) { + // 閫掑綊鏌ヨ鎵�鏈夊瓙鑺傜偣 + List<String> productionIds = mdcProductionService.recursionChildren(mdcEquipment.getProductionName()); + mdcEquipment.setProductionIds(productionIds); + } + return this.baseMapper.exportXlsList(mdcEquipment); + } + } -- Gitblit v1.9.3