From f8afe9baab8538c1cafd5c7b807a0a0f8b63ce94 Mon Sep 17 00:00:00 2001 From: john Date: Thu, 8 Oct 2026 14:44:12 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=81=E4=B9=A6=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=94=B9=E4=B8=BA=E8=A6=86=E7=9B=96=E5=BC=8F?= =?UTF-8?q?=E5=9B=9E=E5=A1=AB=20(=E7=9B=B4=E6=8E=A5=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=E6=97=A7=20URL,=20=E4=B8=8D=E5=86=8D=E9=80=97=E5=8F=B7?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- .../business/service/impl/BizExpertServiceImpl.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ry-api/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizExpertServiceImpl.java b/ry-api/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizExpertServiceImpl.java index 5901136..10fd87b 100644 --- a/ry-api/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizExpertServiceImpl.java +++ b/ry-api/ruoyi-business/src/main/java/com/ruoyi/business/service/impl/BizExpertServiceImpl.java @@ -526,8 +526,6 @@ public class BizExpertServiceImpl implements IBizExpertService int updated = 0; int processed = 0; - // expertId -> 已拼接的 URL (处理同一专家多文件时避免互相覆盖) - Map accumulated = new HashMap<>(); List> results = new ArrayList<>(); for (CertFile f : files) { processed++; @@ -544,17 +542,13 @@ public class BizExpertServiceImpl implements IBizExpertService BizExpert matched = cm.expert; String url = ossUploader.uploadWithOriginalName(f.bytes, f.name, subDir); - String existing = accumulated.containsKey(matched.getExpertId()) - ? accumulated.get(matched.getExpertId()) - : (practice ? matched.getPracticeCertUrl() : matched.getTitleCertUrl()); - String joined = (existing == null || existing.isEmpty()) ? url : existing + "," + url; - accumulated.put(matched.getExpertId(), joined); + // 覆盖式回填: 直接替换为新 URL (证书不允许多张) BizExpert entity = new BizExpert(); entity.setExpertId(matched.getExpertId()); entity.setUpdateBy(username); - if (practice) entity.setPracticeCertUrl(joined); - else entity.setTitleCertUrl(joined); + if (practice) entity.setPracticeCertUrl(url); + else entity.setTitleCertUrl(url); bizExpertMapper.updateByPrimaryKey(entity); updated++;