zhuang 8 달 전
부모
커밋
8b29acbe48
1개의 변경된 파일24개의 추가작업 그리고 1개의 파일을 삭제
  1. 24 1
      business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java

+ 24 - 1
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxProjectManageServiceImpl.java

@@ -2057,7 +2057,29 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
                 rectifySnapVo.setData(data);
                 rectifySnapVos.add(rectifySnapVo);
             });
+            rectifySnapVos.sort((vo1, vo2) -> {
+                String base1 = vo1.getIfoutsidebase();
+                String base2 = vo2.getIfoutsidebase();
 
+                if (base1 == null && base2 == null) {
+                    return 0; // 都是 null
+                }
+                if (base1 == null) {
+                    return 1;                  // null 排最后
+                }
+                if (base2 == null) {
+                    return -1;                 // null 排最后
+                }
+
+                // 自定义排序逻辑: inside < outside
+                if (base1.equals("inside") && !base2.equals("inside")) {
+                    return -1;
+                }
+                if (base1.equals("outside") && base2.equals("inside")) {
+                    return 1;
+                }
+                return base1.compareTo(base2);                // 其他情况默认字典排序
+            });
             Map<String, List<ZhcxProjectRectifySnapVo>> collect4 = v.stream()
                     .filter(e -> Objects.nonNull(e.getDate()))
                     .collect(Collectors.groupingBy(e -> dateFormat.format(e.getDate())));
@@ -2176,6 +2198,7 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
             // 比较数字部分
             return Integer.compare(num1, num2);
         });
+
 //        rectifySnapVos.forEach(snapVo -> {
 //            List<ZhcxProjectRectifySnapDo> dataList = snapVo.getData();
 //            if (dataList != null) {
@@ -2431,7 +2454,7 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
 
                     rowIndex++;
                 }
-                startRow1 += rowIndex +2;
+                startRow1 += snapList.size() +3;
             }
         }
         try {