wangwei 5 роки тому
батько
коміт
9d36a34a64

+ 14 - 1
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/OrgController.java

@@ -8,6 +8,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeMap;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -659,7 +660,19 @@ public class OrgController extends ControllerSupport {
 				+ File.separator + propertyGroupId + "_" + orgId + fileSuffix;
 		filePath = PathUtil.getCanonicalPath(filePath);
 		File file = new File(filePath);
-		String prettyJson = JsonUtil.toPrettyJson(properties);
+
+		Map<String, String> sortedProperties = new TreeMap<String, String>(
+				new java.util.Comparator<String>() {
+					@Override
+					public int compare(String str1, String str2) {
+						return str1.compareTo(str2);
+					}
+
+				});
+
+		sortedProperties.putAll(properties);
+
+		String prettyJson = JsonUtil.toPrettyJson(sortedProperties);
 
 		List<String> urlList = Lists.newArrayList();
 		try {