From a878ff42515bc531e86336f50626cf18ea2ba813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=83=E6=B0=94=E6=BB=A1=E6=BB=A1?= <11056461+jia-guiying@user.noreply.gitee.com> Date: Sat, 8 Feb 2025 12:00:34 +0800 Subject: [PATCH] =?UTF-8?q?2025-2-8=20=E8=AE=BE=E5=A4=87=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=20=E5=89=8D=E7=AB=AFpoolName=E4=BC=A0=E8=BE=93=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=EF=BC=8C=E5=90=8E=E7=AB=AF=E6=94=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DeviceInterfaceController.java | 9 +++++++- .../com/op/device/domain/EquOperation.java | 10 +++++++++ .../impl/DeviceInterfaceServiceImpl.java | 22 ++++++++++--------- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java index cfd3da31..4a9d46cb 100644 --- a/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java +++ b/op-modules/op-device/src/main/java/com/op/device/controller/DeviceInterfaceController.java @@ -1,5 +1,6 @@ package com.op.device.controller; +import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.web.domain.AjaxResult; import com.op.device.domain.*; import com.op.device.service.IDeviceInterfaceService; @@ -27,7 +28,8 @@ public class DeviceInterfaceController { * @return */ @GetMapping("/getRepairWorkOrder") - public AjaxResult getRepairWorkOrder() { + public AjaxResult getRepairWorkOrder(EquOperation equOperation) { + DynamicDataSourceContextHolder.push(equOperation.getPoolName()); return deviceInterfaceService.getRepairWorkOrder(); } @@ -38,6 +40,7 @@ public class DeviceInterfaceController { */ @GetMapping("/getEquipmentInfo") public AjaxResult getEquipmentInfo(EquOperation equOperation) { + DynamicDataSourceContextHolder.push(equOperation.getPoolName()); return deviceInterfaceService.getEquipmentInfo(equOperation); } @@ -48,6 +51,7 @@ public class DeviceInterfaceController { */ @GetMapping("/getRepairQuantity") public AjaxResult getRepairQuantity(EquOperation equOperation) { + DynamicDataSourceContextHolder.push(equOperation.getPoolName()); return deviceInterfaceService.getRepairQuantity(equOperation); } @@ -59,6 +63,7 @@ public class DeviceInterfaceController { */ @GetMapping("/equipmentStability") public AjaxResult getEquipmentStabilityList(EquOperation equOperation) { + DynamicDataSourceContextHolder.push(equOperation.getPoolName()); return deviceInterfaceService.getEquipmentStabilityList(equOperation); } @@ -70,6 +75,7 @@ public class DeviceInterfaceController { */ @GetMapping("/equipmentIntactRate") public AjaxResult getEquipmentIntactRate(EquOperation equOperation) { + DynamicDataSourceContextHolder.push(equOperation.getPoolName()); return deviceInterfaceService.getEquipmentIntactRate(equOperation); } @@ -79,6 +85,7 @@ public class DeviceInterfaceController { */ @GetMapping("/getDeviceRefreshTime") public AjaxResult getDeviceRefreshTime(EquOperation equOperation) { + DynamicDataSourceContextHolder.push(equOperation.getPoolName()); return deviceInterfaceService.getDeviceRefreshTime(equOperation); } diff --git a/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java b/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java index 826eb03e..9a9ab062 100644 --- a/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java +++ b/op-modules/op-device/src/main/java/com/op/device/domain/EquOperation.java @@ -190,6 +190,8 @@ public class EquOperation extends BaseEntity { //设备看板维修质量 mttr private String mttr; + private String poolName; + public String getCreateTimeStart() { return createTimeStart; } @@ -497,6 +499,14 @@ public class EquOperation extends BaseEntity { return mttr; } + public void setPoolName(String poolName) { + this.poolName = poolName; + } + + public String getPoolName() { + return poolName; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java index 2911d476..250fcbdc 100644 --- a/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java +++ b/op-modules/op-device/src/main/java/com/op/device/service/impl/DeviceInterfaceServiceImpl.java @@ -34,17 +34,19 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { * @return */ @Override - @DS("#header.poolName") +// @DS("#header.poolName") public AjaxResult getRepairWorkOrder() { List workOrderVOList = deviceInterfaceMapper.selectEquRepairWorkOrderList(); if(workOrderVOList != null){ for (IRepairWorkOrderVO orderVO : workOrderVOList) { - if(orderVO.getWorkHandle() != null){ - if (orderVO.getWorkHandle().equals("0")) { - orderVO.setWorkHandle("立即"); + if(orderVO != null){ + if(orderVO.getWorkHandle() != null){ + if (orderVO.getWorkHandle().equals("0")) { + orderVO.setWorkHandle("立即"); + } + }else { + orderVO.setWorkHandle("计划"); } - }else { - orderVO.setWorkHandle("计划"); } } } @@ -61,7 +63,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { * @return */ @Override - @DS("#header.poolName") +// @DS("#header.poolName") public AjaxResult getEquipmentInfo(EquOperation equOperation) { if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){ //默认时间 @@ -81,7 +83,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { * @return */ @Override - @DS("#header.poolName") +// @DS("#header.poolName") public AjaxResult getRepairQuantity(EquOperation equOperation) { equOperation.setCreateTime(DateUtils.getNowDate()); if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){ @@ -101,7 +103,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { * 改为:一开始展示默认,可以选择时间 */ @Override - @DS("#header.poolName") +// @DS("#header.poolName") public AjaxResult getEquipmentStabilityList(EquOperation equOperation) { equOperation.setCreateTime(DateUtils.getNowDate()); if((equOperation.getStartTime() == null) && (equOperation.getEndTime() == null)){ @@ -119,7 +121,7 @@ public class DeviceInterfaceServiceImpl implements IDeviceInterfaceService { * 默认为当日的 */ @Override - @DS("#header.poolName") +// @DS("#header.poolName") public AjaxResult getEquipmentIntactRate(EquOperation equOperation) { //查询所有设备(设备停用的除外) equOperation.setCreateTime(DateUtils.getNowDate());