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++;