谐波更改相关功能
This commit is contained in:
@@ -134,39 +134,40 @@ public class PubUtils {
|
||||
/**
|
||||
* 将起始日期字符串 yyyy-MM-dd 转为 yyyy-MM-dd HH:mm:ss的LocalDateTime
|
||||
*/
|
||||
public static LocalDateTime beginTimeToLocalDateTime(String beginTime){
|
||||
public static LocalDateTime beginTimeToLocalDateTime(String beginTime) {
|
||||
beginTime = beginTime + StrUtil.SPACE + "00:00:00";
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DATE_TIME);
|
||||
return LocalDateTime.parse(beginTime, dateTimeFormatter);
|
||||
return LocalDateTime.parse(beginTime, dateTimeFormatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将截止日期字符串 yyyy-MM-dd 转为 yyyy-MM-dd HH:mm:ss的LocalDateTime
|
||||
*/
|
||||
public static LocalDateTime endTimeToLocalDateTime(String endTime){
|
||||
public static LocalDateTime endTimeToLocalDateTime(String endTime) {
|
||||
endTime = endTime + StrUtil.SPACE + "23:59:59";
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DATE_TIME);
|
||||
return LocalDateTime.parse(endTime, dateTimeFormatter);
|
||||
return LocalDateTime.parse(endTime, dateTimeFormatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串日期转为LocalDate日期(只用于日期转换)
|
||||
*/
|
||||
public static LocalDate localDateFormat(String time){
|
||||
public static LocalDate localDateFormat(String time) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DATE);
|
||||
return LocalDate.parse(time,dateTimeFormatter);
|
||||
return LocalDate.parse(time, dateTimeFormatter);
|
||||
}
|
||||
|
||||
public static LocalDateTime localDateTimeFormat(String time){
|
||||
public static LocalDateTime localDateTimeFormat(String time) {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(DATE_TIME);
|
||||
return LocalDateTime.parse(time,dateTimeFormatter);
|
||||
return LocalDateTime.parse(time, dateTimeFormatter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于获取对象中,前缀一样,后缀为2~50的属性值
|
||||
* @param object 待操作对象
|
||||
*
|
||||
* @param object 待操作对象
|
||||
* @param methodPrefix 方法前缀
|
||||
* @param number 方法后缀
|
||||
* @param number 方法后缀
|
||||
* @return 对象属性值
|
||||
*/
|
||||
public static Float getValueByMethod(Object object, String methodPrefix, Integer number) {
|
||||
@@ -231,4 +232,17 @@ public class PubUtils {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer ptTypeName(String ptType) {
|
||||
switch (ptType) {
|
||||
case "星型接线":
|
||||
return 0;
|
||||
case "三角型接线":
|
||||
return 1;
|
||||
case "开口三角型接线":
|
||||
return 2;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user