From 03bdf8738729b6055b0c5594628b261a3ebaaced Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期四, 21 九月 2023 16:50:20 +0800
Subject: [PATCH] 设备健康
---
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
index c18c197..7a1d553 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
@@ -6,6 +6,7 @@
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
+import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellDeptVo;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam;
import com.ruoyi.alarmpoints.well.mapper.ArdAlarmpointsWellMapper;
import com.ruoyi.alarmpoints.well.service.IArdAlarmpointsWellService;
@@ -94,7 +95,7 @@
@Override
@Transactional
public int insertArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) {
- boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId());
+ boolean wellIdExists = checkWellIdExists(ardAlarmpointsWell);
if(wellIdExists)
{
throw new RuntimeException("浜曞彿宸插瓨鍦�");
@@ -115,7 +116,7 @@
@Override
@Transactional
public int updateArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) {
- boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId());
+ boolean wellIdExists = checkWellIdExists(ardAlarmpointsWell);
if(wellIdExists)
{
throw new RuntimeException("浜曞彿宸插瓨鍦�");
@@ -230,7 +231,25 @@
}
}
}
-
+ /**
+ * 鏍稿浜曞彿鏄惁鍞竴
+ *
+ * @param wellId 闇�瑕佹牳瀵圭殑浜曞彿
+ * @return 缁撴灉
+ */
+ @Override
+ public Boolean checkWellIdExists(ArdAlarmpointsWell well) {
+ // 鏍¢獙锛歸ellId
+ String id = (well.getId() == null) ? "" : well.getId();
+ String wellId = well.getWellId();
+ ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.checkWellIdExists(wellId);
+ String infoId = (ardAlarmpointsWell == null) ? "" : (ardAlarmpointsWell.getId());
+ if ((ardAlarmpointsWell != null) && !((infoId).equals(id))) {
+ //宸插瓨鍦�
+ return true;
+ }
+ return false;
+ }
@Override
public List<ArdAlarmpointsWell> wellByDeptList(List<Long> deptList) {
@@ -273,4 +292,9 @@
List<ArdAlarmpointsWell> list = ardAlarmpointsWellMapper.selectList(queryWrapper);
return new PageInfo<>(list);
}
+
+ @Override
+ public List<ArdAlarmpointsWellDeptVo> wellListDept(List<Long> deptList) {
+ return ardAlarmpointsWellMapper.wellListDept(deptList);
+ }
}
--
Gitblit v1.9.3