[update] 修改app实名,修改施工进度计划和填报逻辑

This commit is contained in:
lcj
2025-08-03 00:55:12 +08:00
parent 9cc4ce105e
commit 0b3652ff70
26 changed files with 541 additions and 310 deletions

View File

@ -9,6 +9,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Date;
import java.util.concurrent.TimeUnit;
@ -341,4 +342,22 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
return Date.from(combinedInstant);
}
/**
* 校验日期范围
*
* @param startStr 开始日期字符串,格式为 "yyyy-MM-dd"
* @param endStr 结束日期字符串,格式为 "yyyy-MM-dd"
* @return true 表示日期范围有效false 表示日期范围无效
*/
public static boolean isValidDateRange(String startStr, String endStr) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
try {
LocalDate startDate = LocalDate.parse(startStr, formatter);
LocalDate endDate = LocalDate.parse(endStr, formatter);
return !startDate.isAfter(endDate); // start <= end
} catch (DateTimeParseException e) {
return false; // 格式非法
}
}
}

View File

@ -339,4 +339,16 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
return false;
}
/**
* 判断字符串是否全为数字
*
* @param str 字符串
* @return 是否为数字
*/
public static boolean isAllDigits(String str) {
if (str == null) return false;
String noSpaces = str.replaceAll(" ", "");
return noSpaces.matches("\\d+");
}
}