From 13df4af0cb954740fd23c4bc0553f731161d15fc Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期四, 07 七月 2022 16:17:49 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostSubService.java | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostSubService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostSubService.java
index 5b490f8..2f9f42c 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostSubService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/InterphoneHostSubService.java
@@ -23,17 +23,17 @@
if (hostId == null || subId == null) {
throw new BusinessException("涓昏澶噄d鎴栧瓙璁惧id涓嶈兘涓虹┖");
}
+ InterphoneHostSubPole pole = new InterphoneHostSubPole();
+ InterphoneHost host = SpringContextHolder.getBean(InterphoneHostService.class).getById(hostId);
+ InterphoneHost sub = SpringContextHolder.getBean(InterphoneHostService.class).getById(subId);
+ if (host == null || sub == null) {
+ throw new BusinessException("涓昏澶囨垨瀛愯澶囦笉瀛樺湪");
+ }
InterphoneHostSubPole one = getOne(Wrappers.lambdaQuery(InterphoneHostSubPole.class).eq(InterphoneHostSubPole::getSubId, subId));
if (one != null) {
throw new BusinessException("瀛愯澶囧凡缁戝畾");
}
- InterphoneHostSubPole pole = new InterphoneHostSubPole();
- InterphoneHost host = SpringContextHolder.getBean(InterphoneHostService.class).getById(hostId);
- InterphoneHost sub = SpringContextHolder.getBean(InterphoneHostService.class).getById(subId);
- if (host == null && sub == null) {
- throw new BusinessException("涓昏澶囨垨瀛愯澶囦笉瀛樺湪");
- }
pole.setHostId(hostId);
pole.setSubId(subId);
return save(pole);
--
Gitblit v1.9.3