From acc2ae68a4fc64db75560a20d897c13498494264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=AB=E7=8C=ABguowen?= <9290821+guowen-the-cat@user.noreply.gitee.com> Date: Tue, 23 Dec 2025 13:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/controller/IndexController.java | 103 +++++++++--------- ruoyi-ui/src/views/index.vue | 66 +++++++---- 2 files changed, 97 insertions(+), 72 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/index/controller/IndexController.java b/ruoyi-admin/src/main/java/com/ruoyi/index/controller/IndexController.java index de9557d..3e57e6b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/index/controller/IndexController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/index/controller/IndexController.java @@ -7,6 +7,10 @@ import java.util.Map; import com.ruoyi.device.ddj.domain.MsgDdj; import com.ruoyi.device.ddj.service.IMsgDdjService; +import com.ruoyi.device.srgv.domain.DeviceSrgv; +import com.ruoyi.device.srgv.service.IDeviceSrgvService; +import com.ruoyi.device.tsj.domain.DeviceTsj; +import com.ruoyi.device.tsj.service.IDeviceTsjService; import com.ruoyi.job.domain.MydoJob; import com.ruoyi.job.service.IMydoJobService; import org.springframework.beans.factory.annotation.Autowired; @@ -45,6 +49,12 @@ public class IndexController extends BaseController { @Autowired private IDeviceSsjService deviceSsjService; + @Autowired + private IDeviceSrgvService deviceSrgvService; + + @Autowired + private IDeviceTsjService deviceTsjService; + @Autowired private IMsgDdjService msgDdjService; @@ -58,18 +68,19 @@ public class IndexController extends BaseController { @GetMapping("/deviceStats") public AjaxResult getDeviceStats() { try { - DeviceCar deviceCar = new DeviceCar(); - MsgDdj msgDdj = new MsgDdj(); + DeviceSrgv deviceSrgv = new DeviceSrgv(); + DeviceTsj deviceTsj = new DeviceTsj(); DeviceSsj deviceSsj = new DeviceSsj(); - List deviceList = deviceCarService.selectDeviceCarList(deviceCar); - List msgDdjList = msgDdjService.selectMsgDdjList(msgDdj); + List deviceSsjList = deviceSsjService.selectDeviceSsjList(deviceSsj); + List deviceSrgvList = deviceSrgvService.selectDeviceSrgvList(deviceSrgv); + List deviceTsjList = deviceTsjService.selectDeviceTsjList(deviceTsj); Map count = new HashMap<>(); - count.put("agvCount", deviceList.size()); - count.put("ddjCount", msgDdjList.size()); + count.put("srgvCount", deviceSrgvList.size()); count.put("ssjCount", deviceSsjList.size()); + count.put("tsjCount", deviceTsjList.size()); return AjaxResult.success(count); } catch (Exception e) { @@ -84,8 +95,6 @@ public class IndexController extends BaseController { public AjaxResult getTaskStats() { try { MydoJob mydoJob = new MydoJob(); - AgvQueue agvQueue = new AgvQueue(); - List queueList = agvQueueService.selectAgvQueueList(agvQueue); List mydoJobList = mydoJobService.selectMydoJobList(mydoJob); List mydoJobFinishList = mydoJobService.selectMydoJobFinishList(mydoJob); @@ -144,23 +153,6 @@ public class IndexController extends BaseController { try { List> runningDevices = new ArrayList<>(); - // 查询运行中的AGV和CTU设备 - /*DeviceCar deviceCar = new DeviceCar(); - List deviceList = deviceCarService.selectDeviceCarList(deviceCar); - - for (DeviceCar device : deviceList) { - String taskNo = device.getTaskNo(); - // 判断是否为运行中设备:taskNo不为空且不为0 - if (taskNo != null && !taskNo.trim().isEmpty() && !"0".equals(taskNo.trim())) { - Map deviceInfo = new HashMap<>(); - deviceInfo.put("deviceCode", device.getDeviceCode()); - deviceInfo.put("deviceName", device.getName()); - deviceInfo.put("deviceType", "AGV"); - deviceInfo.put("taskNo", device.getTaskNo()); - runningDevices.add(deviceInfo); - } - }*/ - // 查询运行中的SSJ设备 DeviceSsj deviceSsj = new DeviceSsj(); List ssjList = deviceSsjService.selectDeviceSsjList(deviceSsj); @@ -178,17 +170,30 @@ public class IndexController extends BaseController { } } - MsgDdj msgDdj = new MsgDdj(); - List msgDdjList = msgDdjService.selectMsgDdjList(msgDdj); + DeviceSrgv deviceSrgv = new DeviceSrgv(); + List srgvList = deviceSrgvService.selectDeviceSrgvList(deviceSrgv); + for (DeviceSrgv srgv : srgvList) { + int taskNo = srgv.getTaskNo(); + if (taskNo != 0) { + Map deviceInfo = new HashMap<>(); + deviceInfo.put("deviceCode", srgv.getDeviceId()); + deviceInfo.put("deviceName", srgv.getDeviceName()); + deviceInfo.put("deviceType", "SRGV"); + deviceInfo.put("taskNo", String.valueOf(srgv.getTaskNo())); + runningDevices.add(deviceInfo); + } + } - for (MsgDdj ddj : msgDdjList){ - Long taskNo = ddj.getRwh(); - if (taskNo != 0){ - HashMap deviceInfo = new HashMap<>(); - deviceInfo.put("deviceCode",ddj.getId()); - deviceInfo.put("deviceName", ddj.getName()); - deviceInfo.put("deviceType", "DDJ"); - deviceInfo.put("taskNo", ddj.getRwh()); + DeviceTsj deviceTsj = new DeviceTsj(); + List tsjList = deviceTsjService.selectDeviceTsjList(deviceTsj); + for (DeviceTsj tsj : tsjList) { + Long taskNo = tsj.getRwh(); + if (taskNo != 0) { + Map deviceInfo = new HashMap<>(); + deviceInfo.put("deviceCode", tsj.getId()); + deviceInfo.put("deviceName", tsj.getName()); + deviceInfo.put("deviceType", "TSJ"); + deviceInfo.put("taskNo", String.valueOf(tsj.getRwh())); runningDevices.add(deviceInfo); } } @@ -242,22 +247,22 @@ public class IndexController extends BaseController { public AjaxResult getDeviceStatusChart() { try { Map> statusCount = new HashMap<>(); -// statusCount.put("AGV", new HashMap<>()); - statusCount.put("DDJ", new HashMap<>()); + statusCount.put("SRGV", new HashMap<>()); + statusCount.put("TSJ", new HashMap<>()); statusCount.put("SSJ", new HashMap<>()); // 查询DeviceCar数据(AGV) - DeviceCar deviceCar = new DeviceCar(); - List deviceList = deviceCarService.selectDeviceCarList(deviceCar); + DeviceSrgv deviceSrgv = new DeviceSrgv(); + List deviceSrgvs = deviceSrgvService.selectDeviceSrgvList(deviceSrgv); - for (DeviceCar device : deviceList) { - String taskNo = device.getTaskNo(); + for (DeviceSrgv device : deviceSrgvs) { + int taskNo = device.getTaskNo(); String status = "其他"; // 根据taskNo判断状态:不等于空或0时为运行状态 - if (taskNo != null && !taskNo.trim().isEmpty() && !"0".equals(taskNo.trim())) { + if (taskNo != 0) { status = "运行"; } - Map typeStatusCount = statusCount.get("AGV"); + Map typeStatusCount = statusCount.get("SRGV"); typeStatusCount.put(status, typeStatusCount.getOrDefault(status, 0) + 1); } @@ -279,16 +284,16 @@ public class IndexController extends BaseController { typeStatusCount.put(status, typeStatusCount.getOrDefault(status, 0) + 1); } - MsgDdj msgDdj = new MsgDdj(); - List msgDdjList = msgDdjService.selectMsgDdjList(msgDdj); + DeviceTsj deviceTsj = new DeviceTsj(); + List TsjList = deviceTsjService.selectDeviceTsjList(deviceTsj); - for (MsgDdj ddj : msgDdjList){ - Long taskNo = ddj.getRwh(); + for (DeviceTsj tsj : TsjList){ + Long taskNo = tsj.getRwh(); String status = "其他"; - if (taskNo!=0){ + if (taskNo != 0){ status = "运行"; } - Map typeStatusCount = statusCount.get("DDJ"); + Map typeStatusCount = statusCount.get("TSJ"); typeStatusCount.put(status,typeStatusCount.getOrDefault(status,0) + 1); } diff --git a/ruoyi-ui/src/views/index.vue b/ruoyi-ui/src/views/index.vue index 73fc8cd..0a7d6e0 100644 --- a/ruoyi-ui/src/views/index.vue +++ b/ruoyi-ui/src/views/index.vue @@ -3,20 +3,20 @@ - +
-
{{ deviceStats.ddjCount }}
-
堆垛机设备总数
+
{{ deviceStats.srgvCount }}
+
四向车设备总数
- +
@@ -29,7 +29,20 @@
- + + +
+
+ +
+
+
{{ deviceStats.tsjCount }}
+
提升机设备总数
+
+
+
+
+
@@ -42,7 +55,7 @@
- +
@@ -170,9 +183,10 @@ export default { return { // 统计数据 deviceStats: { - agvCount: 0, - ctuCount: 0, - ssjCount: 0 + srgvCount: 0, + tsjCount: 0, + ssjCount: 0, + tsjCount: 0 }, taskStats: { pendingCount: 0, @@ -414,21 +428,22 @@ export default { if (response.code === 200) { const statusData = response.data - // AGV数据 - /*if (statusData.AGV) { - runningData[0] = statusData.AGV['运行'] || 0 // 运行 - idleData[0] = statusData.AGV['其他'] || 0 // 其他 - }*/ - // CTU数据 - if (statusData.DDJ) { - runningData[0] = statusData.DDJ['运行'] || 0 // 运行 - idleData[0] = statusData.DDJ['其他'] || 0 // 其他 + console.log(statusData) + // SRGV数据 + if (statusData.SRGV) { + runningData[0] = statusData.SRGV['运行'] || 0 // 运行 + idleData[0] = statusData.SRGV['其他'] || 0 // 其他 } // SSJ数据 if (statusData.SSJ) { runningData[1] = statusData.SSJ['运行'] || 0 // 运行 idleData[1] = statusData.SSJ['其他'] || 0 // 其他 } + // TSJ数据 + if (statusData.TSJ) { + runningData[2] = statusData.TSJ['运行'] || 0 // 运行 + idleData[2] = statusData.TSJ['其他'] || 0 // 其他 + } } else { // 默认数据 runningData = [4, 2] @@ -447,7 +462,7 @@ export default { }, xAxis: { type: 'category', - data: ['DDJ', 'SSJ'] + data: ['SRGV', 'SSJ', 'TSJ'] }, yAxis: { type: 'value' @@ -483,7 +498,7 @@ export default { }, xAxis: { type: 'category', - data: ['AGV', 'DDJ', 'SSJ'] + data: ['SRGV', 'SSJ', 'TSJ'] }, yAxis: { type: 'value' @@ -538,8 +553,8 @@ export default { // 获取设备类型文本 getDeviceTypeText(type) { const typeMap = { - '1': 'AGV', - '2': 'CTU', + '1': 'SRGV', + '2': 'TSJ', '3': 'SSJ' } return typeMap[type] || this.$t('index.unknown') // 未知 @@ -618,8 +633,13 @@ export default { background: linear-gradient(135deg, #36d1dc 0%, #5b86e5 100%); } +.tsj-icon { + background: linear-gradient(135deg, #d593fb 0%, #f557e0 100%); +} + + .queue-icon { - background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); + background: linear-gradient(135deg, #fbf993 0%, #f56957 100%); } .running-icon {