Levi.u 4 жил өмнө
parent
commit
78fa2d9ea0

+ 17 - 0
src/main/java/com/ebei/screen/common/util/EbaUtils.java

@@ -35,6 +35,12 @@ public class EbaUtils {
     public static JSONObject realDataDevice;
     public static JSONObject crmProjectInfo;
 
+    private static ResourceBundle resource;
+
+    static {
+        resource = ResourceBundle.getBundle("eba");
+    }
+
     @Autowired
     public void setMongoTemplate(MongoTemplate mongoTemplate) {
         EbaUtils.mongoTemplate = mongoTemplate;
@@ -197,4 +203,15 @@ public class EbaUtils {
         sortSet.addAll(project.keySet());
         return sortSet;
     }
+
+    /**
+     * 给eba项目排序
+     *
+     * @param list
+     * @return
+     */
+    public static List<Map> sortList(List<Map> list) {
+        Collections.sort(list, Comparator.comparingInt(o -> Integer.parseInt(resource.getString(o.get("ebaId").toString()))));
+        return list;
+    }
 }

+ 2 - 2
src/main/java/com/ebei/screen/service/impl/EbaSystemServiceImpl.java

@@ -525,8 +525,8 @@ public class EbaSystemServiceImpl implements EbaSystemService {
         JSONObject data = obj != null ? obj.getJSONObject("data") : new JSONObject();
         JSONObject crmProjectInfo = EbaUtils.crmProjectInfo;
         List<Map> list = new ArrayList<>();
-        data.keySet().forEach(x -> list.add(Levi.by("projectId", x).set("projectName", crmProjectInfo.get(x))));
-        return ResponseBuilder.ok(list);
+        data.keySet().forEach(x -> list.add(Levi.by("projectId", x).set("projectName", crmProjectInfo.get(x)).set("ebaId",data.getString(x))));
+        return ResponseBuilder.ok(EbaUtils.sortList(list));
     }
 
     /**

+ 34 - 0
src/main/resources/eba.properties

@@ -0,0 +1,34 @@
+1249=1
+1250=2
+1255=3
+1277=4
+1278=5
+1256=6
+1258=7
+1259=8
+1279=9
+1280=10
+1281=11
+1286=12
+1282=13
+1291=14
+1290=15
+1294=16
+1293=17
+1292=18
+1296=19
+1289=20
+1275=21
+1276=22
+1270=23
+1260=24
+1285=25
+1283=26
+1274=27
+1261=28
+1273=29
+1272=30
+1295=31
+1287=32
+1288=33
+1297=34