From 9503c595d3508c80cbbacf6e69dca459771d250e Mon Sep 17 00:00:00 2001
From: yuxc <yuxc@vci-tech.com>
Date: 星期三, 15 一月 2025 11:01:54 +0800
Subject: [PATCH] 头像上传获取等接口上传

---
 Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java |   34 +++++++++++++++++++++++++++++++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java
index 7e9ddda..53b7ac3 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/WebIconServiceImpl.java
@@ -71,11 +71,17 @@
                 JSONObject jsonObject = jsonArray.getJSONObject(i);
                 String iconContent = jsonObject.getString("svg");
                 String iconName = jsonObject.getString("name").toLowerCase();
+                if(iconContent.contains("<use href")){
+                    iconContent = iconContent.replace("svg\"", "svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+                    iconContent = iconContent.replace("<use href","<use xlink:href");
+                }
+
                 if(nameList.contains(iconName)){
                     PLIcon icon = iconMap.get(iconName);
                     icon.content = iconContent;
                     icon.type = type;
                     icon.groups = groups;
+                    icon.plModifyUser = WebUtil.getCurrentUserId();
                     updateList.add(icon);
                 }else{
                     PLIcon icon = new PLIcon();
@@ -84,6 +90,7 @@
                     icon.content = iconContent;
                     icon.type = type;
                     icon.groups = groups;
+                    icon.plCreateUser = WebUtil.getCurrentUserId();
                     addList.add(icon);
                 }
             }
@@ -104,13 +111,20 @@
     public void addIcon(PLIconDTO iconDTO) {
         WebUtil.alertNotNull(iconDTO.getName(),"鍥炬爣鍚嶇О", iconDTO.getContent(),"鍥炬爣鍐呭");
 
+        String iconContent = iconDTO.getContent();
+        if(iconContent.contains("<use href")){
+            iconContent = iconContent.replace("svg\"", "svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+            iconContent = iconContent.replace("<use href","<use xlink:href");
+        }
+
         PLIcon plIcon = new PLIcon();
         plIcon.oid = WebUtil.getPk();
         plIcon.name = iconDTO.getName().toLowerCase();
-        plIcon.content = iconDTO.getContent();
+        plIcon.content = iconContent;
         plIcon.type = iconDTO.getType();
         plIcon.groups = iconDTO.getGroups();
-
+        plIcon.plCreateUser = WebUtil.getCurrentUserId();
+        plIcon.plModifyUser = WebUtil.getCurrentUserId();
         try {
             PortalServicePrx portalServicePrx = platformClientUtil.getPortalService();
             portalServicePrx.savePLIcon(plIcon);
@@ -133,9 +147,19 @@
             if(StringUtils.isBlank(plIcon.oid)){
                 throw new VciBaseException("鏈幏鍙栧埌銆�"+iconDTO.getName()+"銆戝浘鏍囦俊鎭紒");
             }
-            plIcon.content = iconDTO.getContent();
+
+            String iconContent = iconDTO.getContent();
+            if(iconContent.contains("<use href")){
+                iconContent = iconContent.replace("svg\"", "svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+                iconContent = iconContent.replace("<use href","<use xlink:href");
+            }
+
+            plIcon.content = iconContent;
             plIcon.type = iconDTO.getType();
             plIcon.groups = iconDTO.getGroups();
+            plIcon.plCreateUser = iconDTO.getPlCreateUser();
+            plIcon.plCreateTime = iconDTO.getPlCreateTime();
+            plIcon.plModifyUser = WebUtil.getCurrentUserId();
             portalServicePrx.updatePLIcon(plIcon);
         } catch (Exception e) {
             throw new RuntimeException(e);
@@ -226,6 +250,10 @@
         vo.setContent(icon.content);
         vo.setType(icon.type);
         vo.setGroups(icon.groups);
+        vo.setPlCreateTime(icon.plCreateTime);
+        vo.setPlCreateUser(icon.plCreateUser);
+        vo.setPlModifyTime(icon.plModifyTime);
+        vo.setPlModifyUser(icon.plModifyUser);
         String[] nameArr = icon.name.split(":");
         if(nameArr.length > 1){
             vo.setLable(nameArr[0]);

--
Gitblit v1.9.3