瀏覽代碼

相机导入修改和筛选

gao.qiang 2 月之前
父節點
當前提交
08ce2a5013

+ 10 - 0
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -766,6 +766,16 @@ public class BaseCameraManagementController extends BaseController {
         });
         for (CameraTree child : children) {
             List<CameraTree> children1 = child.getChildren();
+            children1.sort(new Comparator<CameraTree>() {
+                @Override
+                public int compare(CameraTree o1, CameraTree o2) {
+                    String name1 = ChineseToPingyin.convertHanziToPinyin(o1.getPublicWorksSection());
+                    String substring1 = name1.substring(0, 1);
+                    String name2 = ChineseToPingyin.convertHanziToPinyin(o2.getPublicWorksSection());
+                    String substring2 = name2.substring(0, 1);
+                    return substring1.compareTo(substring2);
+                }
+            });
             for (CameraTree tree3 : children1) {
                 List<CameraTree> cameraTreeList = tree3.getChildren();
                 cameraTreeList.sort(new Comparator<CameraTree>() {