From f813d91421ff6a24b30ef3d1b5d123c08e8331a5 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期三, 14 五月 2025 10:21:46 +0800 Subject: [PATCH] art: 设备管理-数据库设计文件修改 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java | 43 +++++++++++++++++++++++++++++++++++++------ 1 files changed, 37 insertions(+), 6 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java index 3f89858..17d614b 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamReportRepairServiceImpl.java @@ -17,8 +17,12 @@ import org.jeecg.modules.eam.mapper.EamReportRepairMapper; import org.jeecg.modules.eam.request.EamReportRepairQuery; import org.jeecg.modules.eam.service.IEamEquipmentExtendService; +import org.jeecg.modules.eam.service.IEamEquipmentFaultReasonService; import org.jeecg.modules.eam.service.IEamReportRepairService; +import org.jeecg.modules.eam.vo.EquipmentRepairListVO; import org.jeecg.modules.eam.vo.EquipmentRepairStatistics; +import org.jeecg.modules.eam.vo.EquipmentRepairStatusStatistics; +import org.jeecg.modules.eam.vo.FaultTypeStatisticsVO; import org.jeecg.modules.system.service.IMdcProductionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,6 +45,8 @@ private IEamEquipmentExtendService eamEquipmentExtendService; @Autowired private IMdcProductionService mdcProductionService; + @Autowired + private IEamEquipmentFaultReasonService eamEquipmentFaultReasonService; /** * 鍒嗛〉鍒楄〃 @@ -73,15 +79,20 @@ sb.append(detail.getItemCode()).append("銆�"); sb.append(detail.getExceptionDescription()).append(";"); }); + EamEquipmentFaultReason reason = eamEquipmentFaultReasonService.selectByFaultCode(BusinessCodeConst.EFR20250009); EamReportRepair entity = new EamReportRepair(); entity.setEquipmentId(equipmentId); entity.setCreateBy(reportUser); entity.setFaultStartTime(new Date()); entity.setBreakdownFlag(CommonConstant.DEFAULT_0); entity.setDelFlag(CommonConstant.DEL_FLAG_0); - entity.setFaultName("鍛ㄤ繚鎵ц鎶ヤ慨澶勭悊"); - entity.setFaultDescription(sb.toString()); - entity.setFaultType(CommonConstant.DEFAULT_1); + if(reason == null){ + entity.setFaultName("鍛ㄤ繚鎵ц鎶ヤ慨澶勭悊"); + entity.setFaultDescription(sb.toString()); + }else { + entity.setFaultName(reason.getFaultName()); + entity.setFaultType(reason.getFaultCategory()); + } entity.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name()); this.baseMapper.insert(entity); //鏇存柊璁惧缁翠慨鐘舵�� @@ -98,15 +109,20 @@ sb.append(detail.getItemCode()).append("銆�"); sb.append(detail.getExceptionDescription()).append(";"); }); + EamEquipmentFaultReason reason = eamEquipmentFaultReasonService.selectByFaultCode(BusinessCodeConst.EFR20250010); EamReportRepair entity = new EamReportRepair(); entity.setEquipmentId(equipmentId); entity.setCreateBy(reportUser); entity.setFaultStartTime(new Date()); entity.setBreakdownFlag(CommonConstant.DEFAULT_0); entity.setDelFlag(CommonConstant.DEL_FLAG_0); - entity.setFaultName("鐐规鎵ц鎶ヤ慨澶勭悊"); - entity.setFaultDescription(sb.toString()); - entity.setFaultType(CommonConstant.DEFAULT_1); + if(reason == null){ + entity.setFaultName("鐐规鎵ц鎶ヤ慨澶勭悊"); + entity.setFaultDescription(sb.toString()); + }else { + entity.setFaultName(reason.getFaultName()); + entity.setFaultType(reason.getFaultCategory()); + } entity.setReportStatus(ReportRepairEnum.WAIT_REPAIR.name()); this.baseMapper.insert(entity); //鏇存柊璁惧缁翠慨鐘舵�� @@ -177,4 +193,19 @@ } return list; } + + @Override + public EquipmentRepairStatusStatistics repairStatusStatistics() { + return this.baseMapper.repairStatusStatistics(); + } + + @Override + public List<EquipmentRepairListVO> repairList() { + return this.baseMapper.repairList(); + } + + @Override + public List<FaultTypeStatisticsVO> faultTypeStatistics(String start, String end) { + return this.baseMapper.faultTypeStatistics(start, end); + } } -- Gitblit v1.9.3