Parcourir la source

设为关键人或取消关键人

wu il y a 6 mois
Parent
commit
ec938aaaae

+ 14 - 0
src/custom/beans/datatag/DataTag.java

@@ -234,6 +234,20 @@ public class DataTag {
         }
     }
 
+    public static void updateSystemTag(Controller controller, String ownertable, long ownerid, ArrayList<String> tags) throws YosException {
+        ArrayList<String> tagarray = queryTag(controller, ownertable, ownerid, true);
+        for (String tag : tagarray) {
+            if (!tags.contains(tag)) {
+                deleteTag(controller, ownertable, ownerid, tag);
+            }
+        }
+        for (String tag : tags) {
+            if (!tagarray.contains(tag)) {
+                createTag(controller, ownertable, ownerid, tag);
+            }
+        }
+    }
+
     /**
      * 数据标签查询
      *

+ 5 - 0
src/custom/restcontroller/R.java

@@ -7417,6 +7417,11 @@ public class R {
         public static class v1 {
         }
     }
+
+    public static class ID2025110113493702 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 14 - 1
src/custom/restcontroller/system/datatag/datatag.java

@@ -62,7 +62,7 @@ public class datatag extends Controller {
     }
 
     @API(title = "数据标签更新", apiversion = R.ID20220929090901.v1.class)
-    @CACHEING_CLEAN(apiversions = {R.ID20220929085401.class,R.ID20231220085804.class})
+    @CACHEING_CLEAN(apiversions = {R.ID20220929085401.class, R.ID20231220085804.class})
     public String insertormodifyDataTag() throws YosException {
         String ownertable = content.getString("ownertable");
         Long ownerid = content.getLong("ownerid");
@@ -71,4 +71,17 @@ public class datatag extends Controller {
         DataTag.updateTag(this, ownertable, ownerid, list);
         return queryDataTag();
     }
+
+    @API(title = "数据标签更新(系统)", apiversion = R.ID2025110113493702.v1.class)
+    @CACHEING_CLEAN(apiversions = {R.ID20220929085401.class, R.ID20231220085804.class})
+    public String createTag() throws YosException {
+        String ownertable = content.getString("ownertable");
+        Long ownerid = content.getLong("ownerid");
+        JSONArray tagArray = content.getJSONArray("datatag");
+        ArrayList<String> list = (ArrayList<String>) tagArray.toJavaList(String.class);
+        DataTag.updateSystemTag(this, ownertable, ownerid, list);
+        return queryDataTag();
+    }
+
+
 }