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 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

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