From f8ddd7b58b79f88af6bf29ddac36586bb5f87f09 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期二, 27 五月 2025 15:07:44 +0800 Subject: [PATCH] art: 设备管理-三保-启动流程 --- lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java | 62 ++++++++++++++++++++++++++++-- 1 files changed, 57 insertions(+), 5 deletions(-) diff --git a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java index 1bde718..7686edc 100644 --- a/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java +++ b/lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java @@ -1,14 +1,14 @@ package org.jeecg.modules.eam.aspect; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.*; import org.aspectj.lang.reflect.MethodSignature; import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; -import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum; -import org.jeecg.modules.eam.entity.EamEquipment; -import org.jeecg.modules.eam.entity.EamEquipmentHistoryLog; +import org.jeecg.modules.eam.constant.*; +import org.jeecg.modules.eam.entity.*; import org.jeecg.modules.eam.service.IEamEquipmentHistoryLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -54,7 +54,9 @@ log.setBusinessTable(syslog.businessTable()); log.setOperationTag(syslog.operationTag().name()); convertResult(log, syslog.operationTag(), result); - equipmentHistoryLogService.save(log); + if (StringUtils.isNotBlank(log.getEquipmentId())) { + equipmentHistoryLogService.save(log); + } } } @@ -62,7 +64,7 @@ private void convertResult(EamEquipmentHistoryLog log, EquipmentOperationTagEnum operationTag, Object result) { switch (operationTag) { case ACCEPTANCE: - if(result instanceof EamEquipment) { + if (result instanceof EamEquipment) { EamEquipment equipment = (EamEquipment) result; log.setEquipmentId(equipment.getId()); log.setBusinessId(equipment.getId()); @@ -72,14 +74,54 @@ } break; case POINT_INSPECTION: + if (result instanceof EamInspectionOrder) { + EamInspectionOrder order = (EamInspectionOrder) result; + if (InspectionStatus.COMPLETE.name().equals(order.getInspectionStatus())) { + log.setEquipmentId(order.getEquipmentId()); + log.setBusinessId(order.getId()); + log.setOperator(order.getOperator()); + log.setDescription(order.getConfirmComment()); + log.setCreateTime(order.getOperateTime()); + } + } + break; + case WEEK_MAINTENANCE: + if (result instanceof EamWeekMaintenanceOrder) { + EamWeekMaintenanceOrder order = (EamWeekMaintenanceOrder) result; + if (WeekMaintenanceStatusEnum.COMPLETE.name().equals(order.getMaintenanceStatus())) { + log.setEquipmentId(order.getEquipmentId()); + log.setBusinessId(order.getId()); + log.setOperator(order.getOperator()); + log.setDescription(order.getFinalAcceptanceComment()); + log.setCreateTime(order.getActualEndTime()); + } + } break; case SECOND_MAINTENANCE: break; case THIRD_MAINTENANCE: break; case REPORT_REPAIR: + if (result instanceof EamReportRepair) { + EamReportRepair repair = (EamReportRepair) result; + log.setEquipmentId(repair.getEquipmentId()); + log.setBusinessId(repair.getId()); + log.setOperator(repair.getCreateBy()); + log.setDescription(repair.getFaultDescription()); + log.setCreateTime(repair.getFaultStartTime()); + } break; case REPAIRED: + if (result instanceof EamRepairOrder) { + EamRepairOrder order = (EamRepairOrder) result; + if (ReportRepairEnum.COMPLETE.name().equals(order.getRepairStatus())) { + log.setEquipmentId(order.getEquipmentId()); + log.setBusinessId(order.getId()); + log.setOperator(order.getRepairer()); + log.setDescription(order.getRepairDescription()); + log.setCreateTime(order.getActualEndTime()); + } + } break; case MAJOR_REPAIR: break; @@ -94,6 +136,16 @@ case UNSEALED: break; case TRANSFERRED: + if (result instanceof EamEquipmentTransfer) { + EamEquipmentTransfer order = (EamEquipmentTransfer) result; + if (EquipmentTransferStatusEnum.COMPLETE.name().equals(order.getTransferStatus())) { + log.setEquipmentId(order.getEquipmentId()); + log.setBusinessId(order.getId()); + log.setOperator(order.getReportUser()); + log.setDescription(order.getTransferReason()); + log.setCreateTime(order.getTransferTime()); + } + } break; case SCRAPPED: break; -- Gitblit v1.9.3