liujie
2026-03-03 7cbeb85a3e7242f5da2b41b27f3d000943ad337d
Merge remote-tracking branch 'origin/master'
2个文件已修改
22 ■■■■■ 已修改文件
admin-server/src/main/java/com/estate/expert/admin/service/impl/CheckServiceImpl.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-server/src/main/java/com/estate/expert/admin/service/impl/OnDutyServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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. 更新字段
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());
        }