From 86c03bbc2e288482c57f74cf4e40eee386c132ca Mon Sep 17 00:00:00 2001
From: “mitao” <“2763622819@qq.com”>
Date: 星期二, 03 三月 2026 15:39:28 +0800
Subject: [PATCH] fix(app):在岗情况、检查信息已提交提示未显示问题

---
 admin-server/src/main/java/com/estate/expert/admin/service/impl/OnDutyServiceImpl.java |   13 +++++++------
 admin-server/src/main/java/com/estate/expert/admin/service/impl/CheckServiceImpl.java  |    9 +++++----
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/admin-server/src/main/java/com/estate/expert/admin/service/impl/CheckServiceImpl.java b/admin-server/src/main/java/com/estate/expert/admin/service/impl/CheckServiceImpl.java
index 6bdd8e6..bac529a 100644
--- a/admin-server/src/main/java/com/estate/expert/admin/service/impl/CheckServiceImpl.java
+++ b/admin-server/src/main/java/com/estate/expert/admin/service/impl/CheckServiceImpl.java
@@ -17,6 +17,7 @@
 import com.estate.expert.admin.service.CheckService;
 import com.estate.expert.admin.service.CheckTaskService;
 import com.estate.expert.admin.service.ClientService;
+import com.estate.expert.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -77,16 +78,16 @@
         //1.校验任务id
         CheckTask checkTask = checkTaskService.get(request.getCheckTaskIdId());
         if (Objects.isNull(checkTask)) {
-            throw new RuntimeException("检查任务不存在");
+            throw new BizException("检查任务不存在");
         }
         Client client = clientService.get(checkTask.getProject().getClient().getId());
         if (Objects.isNull(client)) {
-            throw new RuntimeException("委托方不存在");
+            throw new BizException("委托方不存在");
         }
         //校验是否已检查
         Long count = lambdaQuery().eq(Check::getCheckTaskId, request.getCheckTaskIdId()).count();
         if (count > 0) {
-            throw new RuntimeException("已检查不可重复上传");
+            throw new BizException("已检查不可重复上传");
         }
         // 1. 创建 Check 实体对象(MyBatis Plus 实体)
         Check check = new Check();
@@ -124,7 +125,7 @@
         // 1. 根据 id 查询现有的 Check 实体
         Check check = getById(request.getId());
         if (check == null) {
-            throw new RuntimeException("检查信息不存在");
+            throw new BizException("检查信息不存在");
         }
 
         // 2. 更新字段
diff --git a/admin-server/src/main/java/com/estate/expert/admin/service/impl/OnDutyServiceImpl.java b/admin-server/src/main/java/com/estate/expert/admin/service/impl/OnDutyServiceImpl.java
index 5550aff..67b1a3c 100644
--- a/admin-server/src/main/java/com/estate/expert/admin/service/impl/OnDutyServiceImpl.java
+++ b/admin-server/src/main/java/com/estate/expert/admin/service/impl/OnDutyServiceImpl.java
@@ -22,6 +22,7 @@
 import com.estate.expert.admin.service.ClientService;
 import com.estate.expert.admin.service.OnDutyService;
 import com.estate.expert.admin.service.PositionService;
+import com.estate.expert.common.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -79,22 +80,22 @@
         //1.校验任务id
         CheckTask checkTask = checkTaskService.get(request.getCheckTaskIdId());
         if (Objects.isNull(checkTask)) {
-            throw new RuntimeException("检查任务不存在");
+            throw new BizException("检查任务不存在");
         }
         Client client = clientService.get(checkTask.getProject().getClient().getId());
         if (Objects.isNull(client)) {
-            throw new RuntimeException("委托方不存在");
+            throw new BizException("委托方不存在");
         }
         // 2. 查询岗位信息,获取 positionName(MyBatis Plus 方式)
         Position position = positionService.getById(request.getPositionId());
         if (position == null) {
-            throw new RuntimeException("岗位不存在");
+            throw new BizException("岗位不存在");
         }
         String positionName = position.getName();
         //校验该岗位是否已添加
         Long count = lambdaQuery().eq(OnDuty::getCheckTaskIdId, request.getCheckTaskIdId()).eq(OnDuty::getPositionId, request.getPositionId()).count();
         if (count > 0) {
-            throw new RuntimeException("该岗位已上传");
+            throw new BizException("该岗位已上传");
         }
 
         // 3. 处理图片列表(逗号分隔)
@@ -155,14 +156,14 @@
         // 1. 查询现有记录
         OnDuty onDuty = this.getById(request.getId());
         if (onDuty == null) {
-            throw new RuntimeException("在岗记录不存在");
+            throw new BizException("在岗记录不存在");
         }
 
         // 2. 如果岗位ID发生变化,需要更新岗位名称(MyBatis Plus 方式)
         if (!onDuty.getPositionId().equals(request.getPositionId())) {
             Position position = positionService.getById(request.getPositionId());
             if (position == null) {
-                throw new RuntimeException("岗位不存在");
+                throw new BizException("岗位不存在");
             }
             onDuty.setPositionName(position.getName());
         }

--
Gitblit v1.7.1