fix[project]: getTaskTree利元亨排序工位兼容待字母的情况
This commit is contained in:
@@ -690,6 +690,16 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
return SdmResponse.success(realTopProjectNodeList.stream().flatMap(item -> item.getChildren().stream().filter(Objects::nonNull)).toList());
|
||||
}
|
||||
|
||||
public static boolean isInteger(String str) {
|
||||
if (str == null || str.trim().isEmpty()) return false;
|
||||
try {
|
||||
Long.parseLong(str); // 支持前导零
|
||||
return true;
|
||||
} catch (NumberFormatException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void sortWorkspaceNode(ProjectNodePo projectNodePo) {
|
||||
List<NodeAllBase> children = projectNodePo.getChildren();
|
||||
if (CollectionUtils.isEmpty(children)) {
|
||||
@@ -709,7 +719,7 @@ public class ProjectServiceImpl extends BaseService implements IProjectService {
|
||||
String[] workspaceNode1 = o1.getNodeCode().split("-");
|
||||
String[] workspaceNode2 = o2.getNodeCode().split("-");
|
||||
|
||||
if (o1.getNodeCode().contains("-M") || o2.getNodeCode().contains("-M")) {
|
||||
if (!isInteger(o1.getNodeCode()) || !isInteger(o2.getNodeCode())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user