Compare commits

..

2 Commits

Author SHA1 Message Date
xuelijun
a83fa8669f Merge remote-tracking branch 'origin/master' 2026-01-28 15:06:48 +08:00
xuelijun
49e75c5b67 修改时间3 2026-01-28 15:06:41 +08:00

View File

@@ -262,20 +262,35 @@ public class CompletedTodayCrawler implements PageProcessor {
if (resultStr == null) {
return "未知";
}
if (resultStr.contains("") || resultStr.contains("+")) {
// 1. 首先解析数字金额
Double amount = parseNumeric(resultStr);
// 方法2通过数字正负判断
if (amount > 0) {
return "";
} else if (resultStr.contains("") || resultStr.contains("-")) {
} else if (amount < 0) {
return "";
} else if (resultStr.contains("") || resultStr.contains("0")) {
return "";
} else if (resultStr.contains("取消")) {
return "取消";
} else {
return "未知";
}
}
/**
* 解析数值
*/
private Double parseNumeric(String numericStr) {
try {
if (numericStr == null || numericStr.isEmpty()) {
return 0.0;
}
// 移除非数字字符(保留小数点和负号)
String cleaned = numericStr.replaceAll("[^\\d.-]", "");
return cleaned.isEmpty() ? 0.0 : Double.parseDouble(cleaned);
} catch (Exception e) {
return 0.0;
}
}
/**
* 解析结果金额
*/