高级算法特征值,暂降事件范围分析代码提交
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.njcn.common.utils;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
@@ -11,6 +12,7 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
@@ -217,6 +219,30 @@ public class PubUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验字符串起始时间和结束时间并返回时间格式时间
|
||||
* @author cdf
|
||||
* @date 2023/8/10
|
||||
*/
|
||||
public static List<LocalDateTime> checkLocalDateTime(String startTime,String endTime) {
|
||||
List<LocalDateTime> resultList = new ArrayList<>();
|
||||
if(StrUtil.isBlank(startTime) || StrUtil.isBlank(endTime)){
|
||||
throw new BusinessException(CommonResponseEnum.TIME_ERROR);
|
||||
}
|
||||
try {
|
||||
startTime = startTime+StrUtil.SPACE+"00:00:00";
|
||||
endTime = endTime+StrUtil.SPACE+"23:59:59";
|
||||
LocalDateTime start = LocalDateTime.parse(startTime,DateTimeFormatter.ofPattern(DATE_TIME));
|
||||
LocalDateTime end = LocalDateTime.parse(endTime,DateTimeFormatter.ofPattern(DATE_TIME));
|
||||
resultList.add(start);
|
||||
resultList.add(end);
|
||||
} catch (Exception e) {
|
||||
throw new BusinessException(CommonResponseEnum.TIME_ERROR);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user