From f19ae260204517279c7c8d47d36f71d6de6bbc36 Mon Sep 17 00:00:00 2001 From: zhangjunwen Date: Mon, 14 Oct 2024 08:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=B1=95=E7=A4=BAfanuc?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=97=B6=EF=BC=8C=E6=96=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=AF=94=E6=97=A7=E6=95=B0=E6=8D=AE=E6=95=B0=E6=8D=AE=E5=B0=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/service/equip/EquipDashboardServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipDashboardServiceImpl.java b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipDashboardServiceImpl.java index 061c121..b741b9f 100644 --- a/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipDashboardServiceImpl.java +++ b/imt-server/imt-module-system/imt-module-system-biz/src/main/java/com/inspur/module/system/service/equip/EquipDashboardServiceImpl.java @@ -67,15 +67,17 @@ public class EquipDashboardServiceImpl implements EquipDashboardService{ vo.setAlarmNum(alarmNum); if(Objects.nonNull(equipInfoDO.getRunStatus()) && equipInfoDO.getRunStatus() != 2) { - //获取工作数据、 + //获取工作数据 Map latestDataMap = dataQueryApi.getLatestFanucData(vo.getEquipId()); Map oldestDataMap = dataQueryApi.getOldestFanucData(vo.getEquipId()); if (CollUtil.isNotEmpty(latestDataMap) && CollUtil.isNotEmpty(oldestDataMap)) { vo.setPowerTime(Double.parseDouble(latestDataMap.get("power_time").toString()) / 60.0); vo.setWorkTime(Double.parseDouble(latestDataMap.get("work_time").toString()) / 60.0); vo.setProcessNum((int) Double.parseDouble(latestDataMap.get("process_num").toString())); - vo.setTodayWorkTime((Double.parseDouble(latestDataMap.get("work_time").toString()) - Double.parseDouble(oldestDataMap.get("work_time").toString())) / 60.0); - vo.setTodayProcessNum((int) (Double.parseDouble(latestDataMap.get("process_num").toString()) - Double.parseDouble(oldestDataMap.get("process_num").toString()))); + double todayWorkTime = (Double.parseDouble(latestDataMap.get("work_time").toString()) - Double.parseDouble(oldestDataMap.get("work_time").toString())) / 60.0; + int todayProcessNum = (int) (Double.parseDouble(latestDataMap.get("process_num").toString()) - Double.parseDouble(oldestDataMap.get("process_num").toString())); + vo.setTodayWorkTime(todayWorkTime < 0 ? Double.parseDouble(latestDataMap.get("work_time").toString()) : todayWorkTime); + vo.setTodayProcessNum(todayProcessNum < 0 ? (int) Double.parseDouble(latestDataMap.get("process_num").toString()) : todayProcessNum); vo.setTodayEfficiency(vo.getTodayProcessNum() / vo.getTodayWorkTime()); } }else{//维修状态