refactor: Date ==> LocalDateTime

This commit is contained in:
xingyu4j 2022-11-09 11:14:46 +08:00
parent 2c1419fb1a
commit 632a132a6a
324 changed files with 1137 additions and 997 deletions

View File

@ -1,8 +1,14 @@
package cn.iocoder.yudao.framework.common.util.date; package cn.iocoder.yudao.framework.common.util.date;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import java.time.Duration; import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -25,6 +31,22 @@ public class DateUtils {
public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss"; public static final String FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND = "yyyy-MM-dd HH:mm:ss";
public static Date localDateTimeToDate(LocalDateTime date){
// 将此日期时间与时区相结合以创建 ZonedDateTime
ZonedDateTime zonedDateTime = date.atZone(ZoneId.systemDefault());
// 本地时间线LocalDateTime到即时时间线Instant时间戳
Instant instant = zonedDateTime.toInstant();
// UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间
return Date.from(instant);
}
public static LocalDateTime dateToLocalDateTime(Date date){
// 转为时间戳
Instant instant = date.toInstant();
// UTC时间(世界协调时间,UTC + 00:00)转北京(北京,UTC + 8:00)时间
return LocalDateTime.ofInstant(instant, ZoneId.systemDefault());
}
public static Date addTime(Duration duration) { public static Date addTime(Duration duration) {
return new Date(System.currentTimeMillis() + duration.toMillis()); return new Date(System.currentTimeMillis() + duration.toMillis());
} }
@ -33,6 +55,11 @@ public class DateUtils {
return System.currentTimeMillis() > time.getTime(); return System.currentTimeMillis() > time.getTime();
} }
public static boolean isExpired(LocalDateTime time) {
LocalDateTime now = LocalDateTime.now();
return now.isAfter(time);
}
public static long diff(Date endTime, Date startTime) { public static long diff(Date endTime, Date startTime) {
return endTime.getTime() - startTime.getTime(); return endTime.getTime() - startTime.getTime();
} }
@ -49,6 +76,10 @@ public class DateUtils {
return buildTime(year, mouth, day, 0, 0, 0); return buildTime(year, mouth, day, 0, 0, 0);
} }
public static LocalDateTime buildLocalDateTime(int year, int mouth, int day) {
return buildLocalDateTime(year, mouth, day, 0, 0, 0);
}
/** /**
* 创建指定时间 * 创建指定时间
* *
@ -73,6 +104,19 @@ public class DateUtils {
return calendar.getTime(); return calendar.getTime();
} }
public static LocalDateTime buildLocalDateTime(int year, int mouth, int day,
int hour, int minute, int second) {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, mouth - 1);
calendar.set(Calendar.DAY_OF_MONTH, day);
calendar.set(Calendar.HOUR_OF_DAY, hour);
calendar.set(Calendar.MINUTE, minute);
calendar.set(Calendar.SECOND, second);
calendar.set(Calendar.MILLISECOND, 0); // 一般情况下都是 0 毫秒
return dateToLocalDateTime(calendar.getTime());
}
public static Date max(Date a, Date b) { public static Date max(Date a, Date b) {
if (a == null) { if (a == null) {
return b; return b;
@ -83,6 +127,16 @@ public class DateUtils {
return a.compareTo(b) > 0 ? a : b; return a.compareTo(b) > 0 ? a : b;
} }
public static LocalDateTime maxLocalDateTime(LocalDateTime a, LocalDateTime b) {
if (a == null) {
return b;
}
if (b == null) {
return a;
}
return a.compareTo(b) > 0 ? a : b;
}
public static boolean beforeNow(Date date) { public static boolean beforeNow(Date date) {
return date.getTime() < System.currentTimeMillis(); return date.getTime() < System.currentTimeMillis();
} }
@ -91,6 +145,10 @@ public class DateUtils {
return date.getTime() >= System.currentTimeMillis(); return date.getTime() >= System.currentTimeMillis();
} }
public static boolean afterNow(LocalDateTime localDateTime) {
return localDateTime.isAfter(LocalDateTime.now());
}
/** /**
* 计算当期时间相差的日期 * 计算当期时间相差的日期
* *
@ -135,4 +193,14 @@ public class DateUtils {
return DateUtil.isSameDay(date, new Date()); return DateUtil.isSameDay(date, new Date());
} }
/**
* 是否今天
*
* @param date 日期
* @return 是否
*/
public static boolean isToday(LocalDateTime date) {
return LocalDateTimeUtil.isSameDay(date, LocalDateTime.now());
}
} }

View File

@ -10,7 +10,7 @@ import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -41,7 +41,7 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader {
/** /**
* 缓存错误码的最大更新时间用于后续的增量轮询判断是否有更新 * 缓存错误码的最大更新时间用于后续的增量轮询判断是否有更新
*/ */
private Date maxUpdateTime; private LocalDateTime maxUpdateTime;
@EventListener(ApplicationReadyEvent.class) @EventListener(ApplicationReadyEvent.class)
public void loadErrorCodes() { public void loadErrorCodes() {
@ -66,7 +66,7 @@ public class ErrorCodeLoaderImpl implements ErrorCodeLoader {
// 写入到错误码的缓存 // 写入到错误码的缓存
putErrorCode(errorCodeRespDTO.getCode(), errorCodeRespDTO.getMessage()); putErrorCode(errorCodeRespDTO.getCode(), errorCodeRespDTO.getMessage());
// 记录下更新时间方便增量更新 // 记录下更新时间方便增量更新
maxUpdateTime = DateUtils.max(maxUpdateTime, errorCodeRespDTO.getUpdateTime()); maxUpdateTime = DateUtils.maxLocalDateTime(maxUpdateTime, errorCodeRespDTO.getUpdateTime());
}); });
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.operatelog.core.aop; package cn.iocoder.yudao.framework.operatelog.core.aop;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -32,6 +33,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.IntStream; import java.util.stream.IntStream;
@ -94,7 +96,7 @@ public class OperateLogAspect {
} }
// 记录开始时间 // 记录开始时间
Date startTime = new Date(); LocalDateTime startTime = LocalDateTime.now();
try { try {
// 执行原有方法 // 执行原有方法
Object result = joinPoint.proceed(); Object result = joinPoint.proceed();
@ -128,7 +130,7 @@ public class OperateLogAspect {
private void log(ProceedingJoinPoint joinPoint, private void log(ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
ApiOperation apiOperation, ApiOperation apiOperation,
Date startTime, Object result, Throwable exception) { LocalDateTime startTime, Object result, Throwable exception) {
try { try {
// 判断不记录的情况 // 判断不记录的情况
if (!isLogEnable(joinPoint, operateLog)) { if (!isLogEnable(joinPoint, operateLog)) {
@ -145,7 +147,7 @@ public class OperateLogAspect {
private void log0(ProceedingJoinPoint joinPoint, private void log0(ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
ApiOperation apiOperation, ApiOperation apiOperation,
Date startTime, Object result, Throwable exception) { LocalDateTime startTime, Object result, Throwable exception) {
OperateLog operateLogObj = new OperateLog(); OperateLog operateLogObj = new OperateLog();
// 补全通用字段 // 补全通用字段
operateLogObj.setTraceId(TracerUtils.getTraceId()); operateLogObj.setTraceId(TracerUtils.getTraceId());
@ -226,7 +228,7 @@ public class OperateLogAspect {
private static void fillMethodFields(OperateLog operateLogObj, private static void fillMethodFields(OperateLog operateLogObj,
ProceedingJoinPoint joinPoint, ProceedingJoinPoint joinPoint,
cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog, cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog operateLog,
Date startTime, Object result, Throwable exception) { LocalDateTime startTime, Object result, Throwable exception) {
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature(); MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
operateLogObj.setJavaMethod(methodSignature.toString()); operateLogObj.setJavaMethod(methodSignature.toString());
if (operateLog == null || operateLog.logArgs()) { if (operateLog == null || operateLog.logArgs()) {
@ -235,7 +237,7 @@ public class OperateLogAspect {
if (operateLog == null || operateLog.logResultData()) { if (operateLog == null || operateLog.logResultData()) {
operateLogObj.setResultData(obtainResultData(result)); operateLogObj.setResultData(obtainResultData(result));
} }
operateLogObj.setDuration((int) (System.currentTimeMillis() - startTime.getTime())); operateLogObj.setDuration((int) (LocalDateTimeUtil.between(startTime, LocalDateTime.now()).toMillis()));
// 正常处理 resultCode resultMsg 字段 // 正常处理 resultCode resultMsg 字段
if (result instanceof CommonResult) { if (result instanceof CommonResult) {
CommonResult<?> commonResult = (CommonResult<?>) result; CommonResult<?> commonResult = (CommonResult<?>) result;

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.operatelog.core.service;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
import java.util.Map; import java.util.Map;
/** /**
@ -85,7 +85,7 @@ public class OperateLog {
/** /**
* 开始时间 * 开始时间
*/ */
private Date startTime; private LocalDateTime startTime;
/** /**
* 执行时长单位毫秒 * 执行时长单位毫秒

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 支付通知 Response DTO * 支付通知 Response DTO
@ -33,7 +33,7 @@ public class PayOrderNotifyRespDTO {
/** /**
* 支付成功时间 * 支付成功时间
*/ */
private Date successTime; private LocalDateTime successTime;
/** /**
* 通知的原始数据 * 通知的原始数据

View File

@ -7,7 +7,7 @@ import org.hibernate.validator.constraints.URL;
import javax.validation.constraints.DecimalMin; import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
import java.util.Map; import java.util.Map;
/** /**
@ -68,7 +68,7 @@ public class PayOrderUnifiedReqDTO {
* 支付过期时间 * 支付过期时间
*/ */
@NotNull(message = "支付过期时间不能为空") @NotNull(message = "支付过期时间不能为空")
private Date expireTime; private LocalDateTime expireTime;
// ========== 拓展参数 ========== // ========== 拓展参数 ==========
/** /**

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 从渠道返回数据中解析得到的支付退款通知的Notify DTO * 从渠道返回数据中解析得到的支付退款通知的Notify DTO
@ -57,7 +57,7 @@ public class PayRefundNotifyDTO {
/** /**
* 退款成功时间 * 退款成功时间
*/ */
private Date refundSuccessTime; private LocalDateTime refundSuccessTime;
} }

View File

@ -1,8 +1,7 @@
package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; package cn.iocoder.yudao.framework.pay.core.client.impl.alipay;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.http.HttpUtil;
import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping; import cn.iocoder.yudao.framework.pay.core.client.AbstractPayCodeMapping;
import cn.iocoder.yudao.framework.pay.core.client.PayCommonResult; import cn.iocoder.yudao.framework.pay.core.client.PayCommonResult;
import cn.iocoder.yudao.framework.pay.core.client.dto.*; import cn.iocoder.yudao.framework.pay.core.client.dto.*;
@ -61,7 +60,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient<AlipayPayCl
return PayOrderNotifyRespDTO.builder().orderExtensionNo(params.get("out_trade_no")) return PayOrderNotifyRespDTO.builder().orderExtensionNo(params.get("out_trade_no"))
.channelOrderNo(params.get("trade_no")).channelUserId(params.get("seller_id")) .channelOrderNo(params.get("trade_no")).channelUserId(params.get("seller_id"))
.tradeStatus(params.get("trade_status")) .tradeStatus(params.get("trade_status"))
.successTime(DateUtil.parse(params.get("notify_time"), "yyyy-MM-dd HH:mm:ss")) .successTime(LocalDateTimeUtil.parse(params.get("notify_time"), "yyyy-MM-dd HH:mm:ss"))
.data(data.getBody()).build(); .data(data.getBody()).build();
} }
@ -72,7 +71,7 @@ public abstract class AbstractAlipayClient extends AbstractPayClient<AlipayPayCl
.tradeNo(params.get("out_trade_no")) .tradeNo(params.get("out_trade_no"))
.reqNo(params.get("out_biz_no")) .reqNo(params.get("out_biz_no"))
.status(PayNotifyRefundStatusEnum.SUCCESS) .status(PayNotifyRefundStatusEnum.SUCCESS)
.refundSuccessTime(DateUtil.parse(params.get("gmt_refund"), "yyyy-MM-dd HH:mm:ss")) .refundSuccessTime(LocalDateTimeUtil.parse(params.get("gmt_refund"), "yyyy-MM-dd HH:mm:ss"))
.build(); .build();
return notifyDTO; return notifyDTO;
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -167,7 +168,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> {
.builder() .builder()
.orderExtensionNo(result.getOutTradeNo()) .orderExtensionNo(result.getOutTradeNo())
.channelOrderNo(result.getTradeState()) .channelOrderNo(result.getTradeState())
.successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) .successTime(LocalDateTimeUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX"))
.data(data.getBody()) .data(data.getBody())
.build(); .build();
} }
@ -181,7 +182,7 @@ public class WXLitePayClient extends AbstractPayClient<WXPayClientConfig> {
.orderExtensionNo(notifyResult.getOutTradeNo()) .orderExtensionNo(notifyResult.getOutTradeNo())
.channelOrderNo(notifyResult.getTransactionId()) .channelOrderNo(notifyResult.getTransactionId())
.channelUserId(notifyResult.getOpenid()) .channelUserId(notifyResult.getOpenid())
.successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) .successTime(LocalDateTimeUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss"))
.data(data.getBody()) .data(data.getBody())
.build(); .build();

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.io.FileUtils; import cn.iocoder.yudao.framework.common.util.io.FileUtils;
@ -150,7 +151,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> {
.builder() .builder()
.orderExtensionNo(result.getOutTradeNo()) .orderExtensionNo(result.getOutTradeNo())
.channelOrderNo(result.getTradeState()) .channelOrderNo(result.getTradeState())
.successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) .successTime(LocalDateTimeUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX"))
.data(data.getBody()) .data(data.getBody())
.build(); .build();
} }
@ -164,7 +165,7 @@ public class WXNativePayClient extends AbstractPayClient<WXPayClientConfig> {
.orderExtensionNo(notifyResult.getOutTradeNo()) .orderExtensionNo(notifyResult.getOutTradeNo())
.channelOrderNo(notifyResult.getTransactionId()) .channelOrderNo(notifyResult.getTransactionId())
.channelUserId(notifyResult.getOpenid()) .channelUserId(notifyResult.getOpenid())
.successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) .successTime(LocalDateTimeUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss"))
.data(data.getBody()) .data(data.getBody())
.build(); .build();

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.framework.pay.core.client.impl.wx;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -161,7 +162,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> {
.builder() .builder()
.orderExtensionNo(result.getOutTradeNo()) .orderExtensionNo(result.getOutTradeNo())
.channelOrderNo(result.getTradeState()) .channelOrderNo(result.getTradeState())
.successTime(DateUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX")) .successTime(LocalDateTimeUtil.parse(result.getSuccessTime(), "yyyy-MM-dd'T'HH:mm:ssXXX"))
.data(data.getBody()) .data(data.getBody())
.build(); .build();
} }
@ -175,7 +176,7 @@ public class WXPubPayClient extends AbstractPayClient<WXPayClientConfig> {
.orderExtensionNo(notifyResult.getOutTradeNo()) .orderExtensionNo(notifyResult.getOutTradeNo())
.channelOrderNo(notifyResult.getTransactionId()) .channelOrderNo(notifyResult.getTransactionId())
.channelUserId(notifyResult.getOpenid()) .channelUserId(notifyResult.getOpenid())
.successTime(DateUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss")) .successTime(LocalDateTimeUtil.parse(notifyResult.getTimeEnd(), "yyyyMMddHHmmss"))
.data(data.getBody()) .data(data.getBody())
.build(); .build();

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.sms.core.client.dto;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 消息接收 Response DTO * 消息接收 Response DTO
@ -32,7 +32,7 @@ public class SmsReceiveRespDTO {
/** /**
* 用户接收时间 * 用户接收时间
*/ */
private Date receiveTime; private LocalDateTime receiveTime;
/** /**
* 短信 API 发送返回的序号 * 短信 API 发送返回的序号

View File

@ -28,7 +28,7 @@ import com.google.common.annotations.VisibleForTesting;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.function.Function; import java.util.function.Function;
@ -166,13 +166,13 @@ public class AliyunSmsClient extends AbstractSmsClient {
*/ */
@JsonProperty("send_time") @JsonProperty("send_time")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date sendTime; private LocalDateTime sendTime;
/** /**
* 状态报告时间 * 状态报告时间
*/ */
@JsonProperty("report_time") @JsonProperty("report_time")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date reportTime; private LocalDateTime reportTime;
/** /**
* 是否接收成功 * 是否接收成功
*/ */

View File

@ -22,7 +22,7 @@ import com.tencentcloudapi.sms.v20210111.SmsClient;
import com.tencentcloudapi.sms.v20210111.models.*; import com.tencentcloudapi.sms.v20210111.models.*;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -240,7 +240,7 @@ public class TencentSmsClient extends AbstractSmsClient {
*/ */
@JsonProperty("user_receive_time") @JsonProperty("user_receive_time")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date receiveTime; private LocalDateTime receiveTime;
/** /**
* 国家或地区 * 国家或地区

View File

@ -23,6 +23,7 @@ import com.yunpian.sdk.model.Template;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -198,7 +199,7 @@ public class YunpianSmsClient extends AbstractSmsClient {
*/ */
@JsonProperty("user_receive_time") @JsonProperty("user_receive_time")
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date userReceiveTime; private LocalDateTime userReceiveTime;
} }

View File

@ -125,7 +125,7 @@ public class AliyunSmsClientTest extends BaseMockitoUnitTest {
assertEquals("DELIVERED", statuses.get(0).getErrorCode()); assertEquals("DELIVERED", statuses.get(0).getErrorCode());
assertEquals("用户接收成功", statuses.get(0).getErrorMsg()); assertEquals("用户接收成功", statuses.get(0).getErrorMsg());
assertEquals("13900000001", statuses.get(0).getMobile()); assertEquals("13900000001", statuses.get(0).getMobile());
assertEquals(DateUtils.buildTime(2017, 2, 2, 22, 23, 24), statuses.get(0).getReceiveTime()); assertEquals(DateUtils.buildLocalDateTime(2017, 2, 2, 22, 23, 24), statuses.get(0).getReceiveTime());
assertEquals("12345", statuses.get(0).getSerialNo()); assertEquals("12345", statuses.get(0).getSerialNo());
assertEquals(67890L, statuses.get(0).getLogId()); assertEquals(67890L, statuses.get(0).getLogId());
} }

View File

@ -146,7 +146,7 @@ public class TencentSmsClientTest extends BaseMockitoUnitTest {
assertEquals("DELIVRD", statuses.get(0).getErrorCode()); assertEquals("DELIVRD", statuses.get(0).getErrorCode());
assertEquals("用户短信送达成功", statuses.get(0).getErrorMsg()); assertEquals("用户短信送达成功", statuses.get(0).getErrorMsg());
assertEquals("13900000001", statuses.get(0).getMobile()); assertEquals("13900000001", statuses.get(0).getMobile());
assertEquals(DateUtils.buildTime(2015, 10, 17, 8, 3, 4), statuses.get(0).getReceiveTime()); assertEquals(DateUtils.buildLocalDateTime(2015, 10, 17, 8, 3, 4), statuses.get(0).getReceiveTime());
assertEquals("12345", statuses.get(0).getSerialNo()); assertEquals("12345", statuses.get(0).getSerialNo());
assertEquals(67890L, statuses.get(0).getLogId()); assertEquals(67890L, statuses.get(0).getLogId());
} }

View File

@ -115,7 +115,7 @@ public class YunpianSmsClientTest extends BaseMockitoUnitTest {
assertEquals("", statuses.get(0).getErrorCode()); assertEquals("", statuses.get(0).getErrorCode());
assertNull(statuses.get(0).getErrorMsg()); assertNull(statuses.get(0).getErrorMsg());
assertEquals("15205201314", statuses.get(0).getMobile()); assertEquals("15205201314", statuses.get(0).getMobile());
assertEquals(DateUtils.buildTime(2014, 3, 17, 22, 55, 21), statuses.get(0).getReceiveTime()); assertEquals(DateUtils.buildLocalDateTime(2014, 3, 17, 22, 55, 21), statuses.get(0).getReceiveTime());
assertEquals("9527", statuses.get(0).getSerialNo()); assertEquals("9527", statuses.get(0).getSerialNo());
assertEquals(1024L, statuses.get(0).getLogId()); assertEquals(1024L, statuses.get(0).getLogId());
} }

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.apollo.internals;
import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -20,7 +20,7 @@ public interface ConfigFrameworkDAO {
* @param maxUpdateTime 最大更新时间 * @param maxUpdateTime 最大更新时间
* @return 是否存在 * @return 是否存在
*/ */
int selectCountByUpdateTimeGt(Date maxUpdateTime); int selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime);
/** /**
* 查询配置列表 * 查询配置列表

View File

@ -18,8 +18,8 @@ import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.time.LocalDateTime;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
@ -48,7 +48,7 @@ public class DBConfigRepository extends AbstractConfigRepository {
/** /**
* 缓存配置的最大更新时间用于后续的增量轮询判断是否有更新 * 缓存配置的最大更新时间用于后续的增量轮询判断是否有更新
*/ */
private volatile Date maxUpdateTime; private volatile LocalDateTime maxUpdateTime;
/** /**
* 配置读取 DAO * 配置读取 DAO
@ -166,7 +166,7 @@ public class DBConfigRepository extends AbstractConfigRepository {
* @param maxUpdateTime 当前配置的最大更新时间 * @param maxUpdateTime 当前配置的最大更新时间
* @return 配置列表 * @return 配置列表
*/ */
private List<ConfigRespDTO> loadConfigIfUpdate(Date maxUpdateTime) { private List<ConfigRespDTO> loadConfigIfUpdate(LocalDateTime maxUpdateTime) {
// 第一步判断是否要更新 // 第一步判断是否要更新
if (maxUpdateTime == null) { // 如果更新时间为空说明 DB 一定有新数据 if (maxUpdateTime == null) { // 如果更新时间为空说明 DB 一定有新数据
log.info("[loadConfigIfUpdate][首次加载全量配置]"); log.info("[loadConfigIfUpdate][首次加载全量配置]");

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.apollo.internals.dto;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 配置 Response DTO * 配置 Response DTO
@ -28,6 +28,6 @@ public class ConfigRespDTO {
/** /**
* 更新时间 * 更新时间
*/ */
private Date updateTime; private LocalDateTime updateTime;
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.quartz.core.handler; package cn.iocoder.yudao.framework.quartz.core.handler;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum; import cn.iocoder.yudao.framework.quartz.core.enums.JobDataKeyEnum;
@ -13,10 +14,10 @@ import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.quartz.QuartzJobBean; import org.springframework.scheduling.quartz.QuartzJobBean;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage; import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.diff;
/** /**
* 基础 Job 调用者负责调用 {@link JobHandler#execute(String)} 执行任务 * 基础 Job 调用者负责调用 {@link JobHandler#execute(String)} 执行任务
@ -46,7 +47,7 @@ public class JobHandlerInvoker extends QuartzJobBean {
// 第二步执行任务 // 第二步执行任务
Long jobLogId = null; Long jobLogId = null;
Date startTime = new Date(); LocalDateTime startTime = LocalDateTime.now();
String data = null; String data = null;
Throwable exception = null; Throwable exception = null;
try { try {
@ -73,9 +74,9 @@ public class JobHandlerInvoker extends QuartzJobBean {
return jobHandler.execute(jobHandlerParam); return jobHandler.execute(jobHandlerParam);
} }
private void updateJobLogResultAsync(Long jobLogId, Date startTime, String data, Throwable exception, private void updateJobLogResultAsync(Long jobLogId, LocalDateTime startTime, String data, Throwable exception,
JobExecutionContext executionContext) { JobExecutionContext executionContext) {
Date endTime = new Date(); LocalDateTime endTime = LocalDateTime.now();
// 处理是否成功 // 处理是否成功
boolean success = exception == null; boolean success = exception == null;
if (!success) { if (!success) {
@ -83,7 +84,7 @@ public class JobHandlerInvoker extends QuartzJobBean {
} }
// 更新日志 // 更新日志
try { try {
jobLogFrameworkService.updateJobLogResultAsync(jobLogId, endTime, (int) diff(endTime, startTime), success, data); jobLogFrameworkService.updateJobLogResultAsync(jobLogId, endTime, (int) LocalDateTimeUtil.between(startTime, endTime).toMillis(), success, data);
} catch (Exception ex) { } catch (Exception ex) {
log.error("[executeInternal][Job({}) logId({}) 记录执行日志失败({}/{})]", log.error("[executeInternal][Job({}) logId({}) 记录执行日志失败({}/{})]",
executionContext.getJobDetail().getKey(), jobLogId, success, data); executionContext.getJobDetail().getKey(), jobLogId, success, data);

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.framework.quartz.core.service;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* Job 日志 Framework Service 接口 * Job 日志 Framework Service 接口
@ -22,7 +22,7 @@ public interface JobLogFrameworkService {
* @return Job 日志的编号 * @return Job 日志的编号
*/ */
Long createJobLog(@NotNull(message = "任务编号不能为空") Long jobId, Long createJobLog(@NotNull(message = "任务编号不能为空") Long jobId,
@NotNull(message = "开始时间") Date beginTime, @NotNull(message = "开始时间") LocalDateTime beginTime,
@NotEmpty(message = "Job 处理器的名字不能为空") String jobHandlerName, @NotEmpty(message = "Job 处理器的名字不能为空") String jobHandlerName,
String jobHandlerParam, String jobHandlerParam,
@NotNull(message = "第几次执行不能为空") Integer executeIndex); @NotNull(message = "第几次执行不能为空") Integer executeIndex);
@ -37,7 +37,7 @@ public interface JobLogFrameworkService {
* @param result 成功数据 * @param result 成功数据
*/ */
void updateJobLogResultAsync(@NotNull(message = "日志编号不能为空") Long logId, void updateJobLogResultAsync(@NotNull(message = "日志编号不能为空") Long logId,
@NotNull(message = "结束时间不能为空") Date endTime, @NotNull(message = "结束时间不能为空") LocalDateTime endTime,
@NotNull(message = "运行时长不能为空") Integer duration, @NotNull(message = "运行时长不能为空") Integer duration,
boolean success, String result); boolean success, String result);

View File

@ -1,8 +1,10 @@
package cn.iocoder.yudao.framework.quartz.core.util; package cn.iocoder.yudao.framework.quartz.core.util;
import cn.hutool.core.date.LocalDateTimeUtil;
import org.quartz.CronExpression; import org.quartz.CronExpression;
import java.text.ParseException; import java.text.ParseException;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -31,7 +33,7 @@ public class CronUtils {
* @param n 数量 * @param n 数量
* @return 满足条件的执行时间 * @return 满足条件的执行时间
*/ */
public static List<Date> getNextTimes(String cronExpression, int n) { public static List<LocalDateTime> getNextTimes(String cronExpression, int n) {
// 获得 CronExpression 对象 // 获得 CronExpression 对象
CronExpression cron; CronExpression cron;
try { try {
@ -41,10 +43,10 @@ public class CronUtils {
} }
// 从当前开始计算n 个满足条件的 // 从当前开始计算n 个满足条件的
Date now = new Date(); Date now = new Date();
List<Date> nextTimes = new ArrayList<>(n); List<LocalDateTime> nextTimes = new ArrayList<>(n);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
Date nextTime = cron.getNextValidTimeAfter(now); Date nextTime = cron.getNextValidTimeAfter(now);
nextTimes.add(nextTime); nextTimes.add(LocalDateTimeUtil.of(nextTime));
// 切换现在为下一个触发时间 // 切换现在为下一个触发时间
now = nextTime; now = nextTime;
} }

View File

@ -7,7 +7,7 @@ import lombok.Data;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 基础实体对象 * 基础实体对象
@ -21,12 +21,12 @@ public abstract class BaseDO implements Serializable {
* 创建时间 * 创建时间
*/ */
@TableField(fill = FieldFill.INSERT) @TableField(fill = FieldFill.INSERT)
private Date createTime; private LocalDateTime createTime;
/** /**
* 最后更新时间 * 最后更新时间
*/ */
@TableField(fill = FieldFill.INSERT_UPDATE) @TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime; private LocalDateTime updateTime;
/** /**
* 创建者目前使用 SysUser id 编号 * 创建者目前使用 SysUser id 编号
* *

View File

@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject; import org.apache.ibatis.reflection.MetaObject;
import java.util.Date; import java.time.LocalDateTime;
import java.util.Objects; import java.util.Objects;
/** /**
@ -22,7 +22,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler {
if (Objects.nonNull(metaObject) && metaObject.getOriginalObject() instanceof BaseDO) { if (Objects.nonNull(metaObject) && metaObject.getOriginalObject() instanceof BaseDO) {
BaseDO baseDO = (BaseDO) metaObject.getOriginalObject(); BaseDO baseDO = (BaseDO) metaObject.getOriginalObject();
Date current = new Date(); LocalDateTime current = LocalDateTime.now();
// 创建时间为空则以当前时间为插入时间 // 创建时间为空则以当前时间为插入时间
if (Objects.isNull(baseDO.getCreateTime())) { if (Objects.isNull(baseDO.getCreateTime())) {
baseDO.setCreateTime(current); baseDO.setCreateTime(current);
@ -49,7 +49,7 @@ public class DefaultDBFieldHandler implements MetaObjectHandler {
// 更新时间为空则以当前时间为更新时间 // 更新时间为空则以当前时间为更新时间
Object modifyTime = getFieldValByName("updateTime", metaObject); Object modifyTime = getFieldValByName("updateTime", metaObject);
if (Objects.isNull(modifyTime)) { if (Objects.isNull(modifyTime)) {
setFieldValByName("updateTime", new Date(), metaObject); setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
} }
// 当前登录用户不为空更新人为空则当前登录用户为更新人 // 当前登录用户不为空更新人为空则当前登录用户为更新人

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.test.core.util; package cn.iocoder.yudao.framework.test.core.util;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
@ -8,6 +9,7 @@ import uk.co.jemos.podam.api.PodamFactory;
import uk.co.jemos.podam.api.PodamFactoryImpl; import uk.co.jemos.podam.api.PodamFactoryImpl;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.time.LocalDateTime;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -76,6 +78,10 @@ public class RandomUtils {
return RandomUtil.randomDay(0, RANDOM_DATE_MAX); return RandomUtil.randomDay(0, RANDOM_DATE_MAX);
} }
public static LocalDateTime randomLocalDateTime() {
return LocalDateTimeUtil.of(randomDate());
}
public static Short randomShort() { public static Short randomShort() {
return (short) RandomUtil.randomInt(0, Short.MAX_VALUE); return (short) RandomUtil.randomInt(0, Short.MAX_VALUE);
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.framework.apilog.core.filter; package cn.iocoder.yudao.framework.apilog.core.filter;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.exceptions.ExceptionUtil; import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.map.MapUtil; import cn.hutool.core.map.MapUtil;
import cn.hutool.extra.servlet.ServletUtil; import cn.hutool.extra.servlet.ServletUtil;
@ -7,7 +8,6 @@ import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLog;
import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService; import cn.iocoder.yudao.framework.apilog.core.service.ApiAccessLogFrameworkService;
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants; import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils; import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils; import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
import cn.iocoder.yudao.framework.web.config.WebProperties; import cn.iocoder.yudao.framework.web.config.WebProperties;
@ -20,7 +20,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Date; import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.Map; import java.util.Map;
import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString;
@ -47,7 +48,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException { throws ServletException, IOException {
// 获得开始时间 // 获得开始时间
Date beginTim = new Date(); LocalDateTime beginTime = LocalDateTime.now();
// 提前获得参数避免 XssFilter 过滤处理 // 提前获得参数避免 XssFilter 过滤处理
Map<String, String> queryString = ServletUtil.getParamMap(request); Map<String, String> queryString = ServletUtil.getParamMap(request);
String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtil.getBody(request) : null; String requestBody = ServletUtils.isJsonRequest(request) ? ServletUtil.getBody(request) : null;
@ -56,15 +57,15 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
// 继续过滤器 // 继续过滤器
filterChain.doFilter(request, response); filterChain.doFilter(request, response);
// 正常执行记录日志 // 正常执行记录日志
createApiAccessLog(request, beginTim, queryString, requestBody, null); createApiAccessLog(request, beginTime, queryString, requestBody, null);
} catch (Exception ex) { } catch (Exception ex) {
// 异常执行记录日志 // 异常执行记录日志
createApiAccessLog(request, beginTim, queryString, requestBody, ex); createApiAccessLog(request, beginTime, queryString, requestBody, ex);
throw ex; throw ex;
} }
} }
private void createApiAccessLog(HttpServletRequest request, Date beginTime, private void createApiAccessLog(HttpServletRequest request, LocalDateTime beginTime,
Map<String, String> queryString, String requestBody, Exception ex) { Map<String, String> queryString, String requestBody, Exception ex) {
ApiAccessLog accessLog = new ApiAccessLog(); ApiAccessLog accessLog = new ApiAccessLog();
try { try {
@ -75,7 +76,7 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
} }
} }
private void buildApiAccessLogDTO(ApiAccessLog accessLog, HttpServletRequest request, Date beginTime, private void buildApiAccessLogDTO(ApiAccessLog accessLog, HttpServletRequest request, LocalDateTime beginTime,
Map<String, String> queryString, String requestBody, Exception ex) { Map<String, String> queryString, String requestBody, Exception ex) {
// 处理用户信息 // 处理用户信息
accessLog.setUserId(WebFrameworkUtils.getLoginUserId(request)); accessLog.setUserId(WebFrameworkUtils.getLoginUserId(request));
@ -103,8 +104,8 @@ public class ApiAccessLogFilter extends ApiRequestFilter {
accessLog.setUserIp(ServletUtil.getClientIP(request)); accessLog.setUserIp(ServletUtil.getClientIP(request));
// 持续时间 // 持续时间
accessLog.setBeginTime(beginTime); accessLog.setBeginTime(beginTime);
accessLog.setEndTime(new Date()); accessLog.setEndTime(LocalDateTime.now());
accessLog.setDuration((int) DateUtils.diff(accessLog.getEndTime(), accessLog.getBeginTime())); accessLog.setDuration((int) LocalDateTimeUtil.between(accessLog.getBeginTime(), accessLog.getEndTime(), ChronoUnit.SECONDS));
} }
} }

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.apilog.core.service;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 访问日志 * API 访问日志
@ -61,12 +61,12 @@ public class ApiAccessLog {
* 开始请求时间 * 开始请求时间
*/ */
@NotNull(message = "开始请求时间不能为空") @NotNull(message = "开始请求时间不能为空")
private Date beginTime; private LocalDateTime beginTime;
/** /**
* 结束请求时间 * 结束请求时间
*/ */
@NotNull(message = "结束请求时间不能为空") @NotNull(message = "结束请求时间不能为空")
private Date endTime; private LocalDateTime endTime;
/** /**
* 执行时长单位毫秒 * 执行时长单位毫秒
*/ */

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.framework.apilog.core.service;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 错误日志 * API 错误日志
@ -61,7 +61,7 @@ public class ApiErrorLog {
* 异常时间 * 异常时间
*/ */
@NotNull(message = "异常时间不能为空") @NotNull(message = "异常时间不能为空")
private Date exceptionTime; private LocalDateTime exceptionTime;
/** /**
* 异常名 * 异常名
*/ */

View File

@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation; import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException; import javax.validation.ConstraintViolationException;
import javax.validation.ValidationException; import javax.validation.ValidationException;
import java.util.Date; import java.time.LocalDateTime;
import java.util.Map; import java.util.Map;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.*; import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.*;
@ -267,7 +267,7 @@ public class GlobalExceptionHandler {
errorLog.setRequestMethod(request.getMethod()); errorLog.setRequestMethod(request.getMethod());
errorLog.setUserAgent(ServletUtils.getUserAgent(request)); errorLog.setUserAgent(ServletUtils.getUserAgent(request));
errorLog.setUserIp(ServletUtil.getClientIP(request)); errorLog.setUserIp(ServletUtil.getClientIP(request));
errorLog.setExceptionTime(new Date()); errorLog.setExceptionTime(LocalDateTime.now());
} }
} }

View File

@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 动态表单 Response VO") @ApiModel("管理后台 - 动态表单 Response VO")
@ -28,6 +28,6 @@ public class BpmFormRespVO extends BpmFormBaseVO {
private List<String> fields; private List<String> fields;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -9,7 +9,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 用户组分页 Request VO") @ApiModel("管理后台 - 用户组分页 Request VO")
@Data @Data
@ -25,6 +25,6 @@ public class BpmUserGroupPageReqVO extends PageParam {
@DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -1,7 +1,9 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group;
import lombok.*; import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ApiModel("管理后台 - 用户组 Response VO") @ApiModel("管理后台 - 用户组 Response VO")
@ -14,6 +16,6 @@ public class BpmUserGroupRespVO extends BpmUserGroupBaseVO {
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程模型的分页的每一项 Response VO") @ApiModel("管理后台 - 流程模型的分页的每一项 Response VO")
@Data @Data
@ -21,7 +21,7 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO {
private String formName; private String formName;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
/** /**
* 最新部署的流程定义 * 最新部署的流程定义
@ -39,7 +39,7 @@ public class BpmModelPageItemRespVO extends BpmModelBaseVO {
private Integer version; private Integer version;
@ApiModelProperty(value = "部署时间", required = true) @ApiModelProperty(value = "部署时间", required = true)
private Date deploymentTime; private LocalDateTime deploymentTime;
@ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") @ApiModelProperty(value = "中断状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
private Integer suspensionState; private Integer suspensionState;

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程模型的创建 Request VO") @ApiModel("管理后台 - 流程模型的创建 Request VO")
@Data @Data
@ -21,6 +21,6 @@ public class BpmModelRespVO extends BpmModelBaseVO {
private String bpmnXml; private String bpmnXml;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程定义的分页的每一项 Response VO") @ApiModel("管理后台 - 流程定义的分页的每一项 Response VO")
@Data @Data
@ -18,6 +18,6 @@ public class BpmProcessDefinitionPageItemRespVO extends BpmProcessDefinitionResp
private String formName; private String formName;
@ApiModelProperty(value = "部署时间", required = true) @ApiModelProperty(value = "部署时间", required = true)
private Date deploymentTime; private LocalDateTime deploymentTime;
} }

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo;
import lombok.*; import lombok.*;
import java.util.*; import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -18,11 +18,11 @@ public class BpmOALeaveBaseVO {
@ApiModelProperty(value = "请假的开始时间", required = true) @ApiModelProperty(value = "请假的开始时间", required = true)
@NotNull(message = "开始时间不能为空") @NotNull(message = "开始时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date startTime; private LocalDateTime startTime;
@ApiModelProperty(value = "请假的结束时间", required = true) @ApiModelProperty(value = "请假的结束时间", required = true)
@NotNull(message = "结束时间不能为空") @NotNull(message = "结束时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举") @ApiModelProperty(value = "请假类型", required = true, example = "1", notes = "参见 bpm_oa_type 枚举")
private Integer type; private Integer type;

View File

@ -15,7 +15,7 @@ public class BpmOALeaveCreateReqVO extends BpmOALeaveBaseVO {
@AssertTrue(message = "结束时间,需要在开始时间之后") @AssertTrue(message = "结束时间,需要在开始时间之后")
public boolean isEndTimeValid() { public boolean isEndTimeValid() {
return !getEndTime().before(getStartTime()); return !getEndTime().isBefore(getStartTime());
} }
} }

View File

@ -1,7 +1,7 @@
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo; package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo;
import lombok.*; import lombok.*;
import java.util.*; import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -25,6 +25,6 @@ public class BpmOALeavePageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "申请时间") @ApiModelProperty(value = "申请时间")
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -5,7 +5,7 @@ import io.swagger.annotations.*;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -24,7 +24,7 @@ public class BpmOALeaveRespVO extends BpmOALeaveBaseVO {
@ApiModelProperty(value = "申请时间", required = true) @ApiModelProperty(value = "申请时间", required = true)
@NotNull(message = "申请时间不能为空") @NotNull(message = "申请时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "流程id") @ApiModelProperty(value = "流程id")
private String processInstanceId; private String processInstanceId;

View File

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程活动的 Response VO") @ApiModel("管理后台 - 流程活动的 Response VO")
@Data @Data
@ -16,9 +16,9 @@ public class BpmActivityRespVO {
private String type; private String type;
@ApiModelProperty(value = "流程活动的开始时间", required = true) @ApiModelProperty(value = "流程活动的开始时间", required = true)
private Date startTime; private LocalDateTime startTime;
@ApiModelProperty(value = "流程活动的结束时间", required = true) @ApiModelProperty(value = "流程活动的结束时间", required = true)
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有") @ApiModelProperty(value = "关联的流程任务的编号", example = "2048", notes = "关联的流程任务,只有 UserTask 等类型才有")
private String taskId; private String taskId;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -35,6 +35,6 @@ public class BpmProcessInstanceMyPageReqVO extends PageParam {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
@ApiModel("管理后台 - 流程实例的分页 Item Response VO") @ApiModel("管理后台 - 流程实例的分页 Item Response VO")
@ -30,10 +30,10 @@ public class BpmProcessInstancePageItemRespVO {
private Integer result; private Integer result;
@ApiModelProperty(value = "提交时间", required = true) @ApiModelProperty(value = "提交时间", required = true)
private Date createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "结束时间", required = true) @ApiModelProperty(value = "结束时间", required = true)
private Date endTime; private LocalDateTime endTime;
/** /**
* 当前任务 * 当前任务

View File

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -28,10 +28,10 @@ public class BpmProcessInstanceRespVO {
private Integer result; private Integer result;
@ApiModelProperty(value = "提交时间", required = true) @ApiModelProperty(value = "提交时间", required = true)
private Date createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "结束时间", required = true) @ApiModelProperty(value = "结束时间", required = true)
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "提交的表单值", required = true) @ApiModelProperty(value = "提交的表单值", required = true)
private Map<String, Object> formVariables; private Map<String, Object> formVariables;

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程任务的 Done 已完成的分页项 Response VO") @ApiModel("管理后台 - 流程任务的 Done 已完成的分页项 Response VO")
@Data @Data
@ -15,7 +15,7 @@ import java.util.Date;
public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO { public class BpmTaskDonePageItemRespVO extends BpmTaskTodoPageItemRespVO {
@ApiModelProperty(value = "结束时间", required = true) @ApiModelProperty(value = "结束时间", required = true)
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "持续时间", required = true, example = "1000") @ApiModelProperty(value = "持续时间", required = true, example = "1000")
private Long durationInMillis; private Long durationInMillis;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -23,10 +23,10 @@ public class BpmTaskDonePageReqVO extends PageParam {
@ApiModelProperty(value = "开始的创建收间") @ApiModelProperty(value = "开始的创建收间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginCreateTime; private LocalDateTime beginCreateTime;
@ApiModelProperty(value = "结束的创建时间") @ApiModelProperty(value = "结束的创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endCreateTime; private LocalDateTime endCreateTime;
} }

View File

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 流程任务的 Running 进行中的分页项 Response VO") @ApiModel("管理后台 - 流程任务的 Running 进行中的分页项 Response VO")
@Data @Data
@ -17,10 +17,10 @@ public class BpmTaskTodoPageItemRespVO {
private String name; private String name;
@ApiModelProperty(value = "接收时间", required = true) @ApiModelProperty(value = "接收时间", required = true)
private Date claimTime; private LocalDateTime claimTime;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "激活状态", required = true, example = "1", notes = "参见 SuspensionState 枚举") @ApiModelProperty(value = "激活状态", required = true, example = "1", notes = "参见 SuspensionState 枚举")
private Integer suspensionState; private Integer suspensionState;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -23,10 +23,10 @@ public class BpmTaskTodoPageReqVO extends PageParam {
@ApiModelProperty(value = "开始的创建收间") @ApiModelProperty(value = "开始的创建收间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginCreateTime; private LocalDateTime beginCreateTime;
@ApiModelProperty(value = "结束的创建时间") @ApiModelProperty(value = "结束的创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endCreateTime; private LocalDateTime endCreateTime;
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.convert.definition;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.*;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
@ -44,7 +45,7 @@ public interface BpmModelConvert {
default BpmModelPageItemRespVO convert(Model model, BpmFormDO form, Deployment deployment, ProcessDefinition processDefinition) { default BpmModelPageItemRespVO convert(Model model, BpmFormDO form, Deployment deployment, ProcessDefinition processDefinition) {
BpmModelPageItemRespVO modelRespVO = new BpmModelPageItemRespVO(); BpmModelPageItemRespVO modelRespVO = new BpmModelPageItemRespVO();
modelRespVO.setId(model.getId()); modelRespVO.setId(model.getId());
modelRespVO.setCreateTime(model.getCreateTime()); modelRespVO.setCreateTime(DateUtils.dateToLocalDateTime(model.getCreateTime()));
// 通用 copy // 通用 copy
copyTo(model, modelRespVO); copyTo(model, modelRespVO);
// Form // Form
@ -57,7 +58,7 @@ public interface BpmModelConvert {
if (modelRespVO.getProcessDefinition() != null) { if (modelRespVO.getProcessDefinition() != null) {
modelRespVO.getProcessDefinition().setSuspensionState(processDefinition.isSuspended() ? modelRespVO.getProcessDefinition().setSuspensionState(processDefinition.isSuspended() ?
SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode()); SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
modelRespVO.getProcessDefinition().setDeploymentTime(deployment.getDeploymentTime()); modelRespVO.getProcessDefinition().setDeploymentTime(DateUtils.dateToLocalDateTime(deployment.getDeploymentTime()));
} }
return modelRespVO; return modelRespVO;
} }
@ -65,7 +66,7 @@ public interface BpmModelConvert {
default BpmModelRespVO convert(Model model) { default BpmModelRespVO convert(Model model) {
BpmModelRespVO modelRespVO = new BpmModelRespVO(); BpmModelRespVO modelRespVO = new BpmModelRespVO();
modelRespVO.setId(model.getId()); modelRespVO.setId(model.getId());
modelRespVO.setCreateTime(model.getCreateTime()); modelRespVO.setCreateTime(DateUtils.dateToLocalDateTime(model.getCreateTime()));
// 通用 copy // 通用 copy
copyTo(model, modelRespVO); copyTo(model, modelRespVO);
return modelRespVO; return modelRespVO;

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.bpm.convert.definition; package cn.iocoder.yudao.module.bpm.convert.definition;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageItemRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionPageItemRespVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process.BpmProcessDefinitionRespVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmFormDO;
@ -67,7 +69,7 @@ public interface BpmProcessDefinitionConvert {
BpmProcessDefinitionPageItemRespVO respVO = convert(bean); BpmProcessDefinitionPageItemRespVO respVO = convert(bean);
respVO.setSuspensionState(bean.isSuspended() ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode()); respVO.setSuspensionState(bean.isSuspended() ? SuspensionState.SUSPENDED.getStateCode() : SuspensionState.ACTIVE.getStateCode());
if (deployment != null) { if (deployment != null) {
respVO.setDeploymentTime(deployment.getDeploymentTime()); respVO.setDeploymentTime(LocalDateTimeUtil.of(deployment.getDeploymentTime()));
} }
if (form != null) { if (form != null) {
respVO.setFormName(form.getName()); respVO.setFormName(form.getName());

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.bpm.convert.task; package cn.iocoder.yudao.module.bpm.convert.task;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils; import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskDonePageItemRespVO; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskDonePageItemRespVO;
@ -151,7 +152,7 @@ public interface BpmTaskConvert {
BpmTaskExtDO taskExtDO = new BpmTaskExtDO().setTaskId(task.getId()) BpmTaskExtDO taskExtDO = new BpmTaskExtDO().setTaskId(task.getId())
.setAssigneeUserId(NumberUtils.parseLong(task.getAssignee())).setName(task.getName()) .setAssigneeUserId(NumberUtils.parseLong(task.getAssignee())).setName(task.getName())
.setProcessDefinitionId(task.getProcessDefinitionId()).setProcessInstanceId(task.getProcessInstanceId()); .setProcessDefinitionId(task.getProcessDefinitionId()).setProcessInstanceId(task.getProcessInstanceId());
taskExtDO.setCreateTime(task.getCreateTime()); taskExtDO.setCreateTime(LocalDateTimeUtil.of(task.getCreateTime()));
return taskExtDO; return taskExtDO;
} }

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
import lombok.*; import lombok.*;
import java.util.*; import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
@ -46,11 +46,11 @@ public class BpmOALeaveDO extends BaseDO {
/** /**
* 开始时间 * 开始时间
*/ */
private Date startTime; private LocalDateTime startTime;
/** /**
* 结束时间 * 结束时间
*/ */
private Date endTime; private LocalDateTime endTime;
/** /**
* 请假天数 * 请假天数
*/ */

View File

@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*; import lombok.*;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
@ -80,18 +80,18 @@ public class BpmActivityDO {
*/ */
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date startTime; private LocalDateTime startTime;
/** /**
* 任务结束时间 * 任务结束时间
*/ */
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
private Date endTime; private LocalDateTime endTime;
private Integer transactionOrder; private Integer transactionOrder;
private Long duration; private LocalDateTime duration;
/** /**
* 删除结果 * 删除结果

View File

@ -11,7 +11,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
import java.util.Map; import java.util.Map;
/** /**
@ -79,7 +79,7 @@ public class BpmProcessInstanceExtDO extends BaseDO {
* *
* 冗余 HistoricProcessInstance endTime 属性 * 冗余 HistoricProcessInstance endTime 属性
*/ */
private Date endTime; private LocalDateTime endTime;
/** /**
* 提交的表单值 * 提交的表单值

View File

@ -8,7 +8,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* Bpm 流程任务的拓展表 * Bpm 流程任务的拓展表
@ -67,7 +67,7 @@ public class BpmTaskExtDO extends BaseDO {
* *
* 冗余 HistoricTaskInstance endTime 属性 * 冗余 HistoricTaskInstance endTime 属性
*/ */
private Date endTime; private LocalDateTime endTime;
/** /**
* 流程实例的编号 * 流程实例的编号

View File

@ -1,6 +1,6 @@
package cn.iocoder.yudao.module.bpm.service.oa; package cn.iocoder.yudao.module.bpm.service.oa;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
@ -46,7 +46,7 @@ public class BpmOALeaveServiceImpl implements BpmOALeaveService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Long createLeave(Long userId, BpmOALeaveCreateReqVO createReqVO) { public Long createLeave(Long userId, BpmOALeaveCreateReqVO createReqVO) {
// 插入 OA 请假单 // 插入 OA 请假单
long day = DateUtil.betweenDay(createReqVO.getStartTime(), createReqVO.getEndTime(), false); long day = LocalDateTimeUtil.between(createReqVO.getStartTime(), createReqVO.getEndTime()).toDays();
BpmOALeaveDO leave = BpmOALeaveConvert.INSTANCE.convert(createReqVO).setUserId(userId).setDay(day) BpmOALeaveDO leave = BpmOALeaveConvert.INSTANCE.convert(createReqVO).setUserId(userId).setDay(day)
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult()); .setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
leaveMapper.insert(leave); leaveMapper.insert(leave);

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.bpm.service.task;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
import cn.iocoder.yudao.framework.common.util.number.NumberUtils; import cn.iocoder.yudao.framework.common.util.number.NumberUtils;
import cn.iocoder.yudao.framework.common.util.object.PageUtils; import cn.iocoder.yudao.framework.common.util.object.PageUtils;
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*; import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*;
@ -32,6 +33,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -74,10 +76,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
taskQuery.taskNameLike("%" + pageVO.getName() + "%"); taskQuery.taskNameLike("%" + pageVO.getName() + "%");
} }
if (pageVO.getBeginCreateTime() != null) { if (pageVO.getBeginCreateTime() != null) {
taskQuery.taskCreatedAfter(pageVO.getBeginCreateTime()); taskQuery.taskCreatedAfter(DateUtils.localDateTimeToDate(pageVO.getBeginCreateTime()));
} }
if (pageVO.getEndCreateTime() != null) { if (pageVO.getEndCreateTime() != null) {
taskQuery.taskCreatedBefore(pageVO.getEndCreateTime()); taskQuery.taskCreatedBefore(DateUtils.localDateTimeToDate(pageVO.getEndCreateTime()));
} }
// 执行查询 // 执行查询
List<Task> tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize()); List<Task> tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
@ -106,10 +108,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
taskQuery.taskNameLike("%" + pageVO.getName() + "%"); taskQuery.taskNameLike("%" + pageVO.getName() + "%");
} }
if (pageVO.getBeginCreateTime() != null) { if (pageVO.getBeginCreateTime() != null) {
taskQuery.taskCreatedAfter(pageVO.getBeginCreateTime()); taskQuery.taskCreatedAfter(DateUtils.localDateTimeToDate(pageVO.getBeginCreateTime()));
} }
if (pageVO.getEndCreateTime() != null) { if (pageVO.getEndCreateTime() != null) {
taskQuery.taskCreatedBefore(pageVO.getEndCreateTime()); taskQuery.taskCreatedBefore(DateUtils.localDateTimeToDate(pageVO.getEndCreateTime()));
} }
// 执行查询 // 执行查询
List<HistoricTaskInstance> tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize()); List<HistoricTaskInstance> tasks = taskQuery.listPage(PageUtils.getStart(pageVO), pageVO.getPageSize());
@ -205,7 +207,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
// 更新任务拓展表为不通过 // 更新任务拓展表为不通过
taskExtMapper.updateByTaskId( taskExtMapper.updateByTaskId(
new BpmTaskExtDO().setTaskId(task.getId()).setResult(BpmProcessInstanceResultEnum.REJECT.getResult()) new BpmTaskExtDO().setTaskId(task.getId()).setResult(BpmProcessInstanceResultEnum.REJECT.getResult())
.setEndTime(new Date()).setReason(reqVO.getReason())); .setEndTime(LocalDateTime.now()).setReason(reqVO.getReason()));
} }
@Override @Override
@ -249,7 +251,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
public void updateTaskExtComplete(Task task) { public void updateTaskExtComplete(Task task) {
BpmTaskExtDO taskExtDO = BpmTaskConvert.INSTANCE.convert2TaskExt(task) BpmTaskExtDO taskExtDO = BpmTaskConvert.INSTANCE.convert2TaskExt(task)
.setResult(BpmProcessInstanceResultEnum.APPROVE.getResult()) // 不设置也问题不大因为 Complete 一般是审核通过已经设置 .setResult(BpmProcessInstanceResultEnum.APPROVE.getResult()) // 不设置也问题不大因为 Complete 一般是审核通过已经设置
.setEndTime(new Date()); .setEndTime(LocalDateTime.now());
taskExtMapper.updateByTaskId(taskExtDO); taskExtMapper.updateByTaskId(taskExtDO);
} }
@ -280,7 +282,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
// 更新任务 // 更新任务
taskExtMapper.updateById(new BpmTaskExtDO().setId(taskExt.getId()).setResult(BpmProcessInstanceResultEnum.CANCEL.getResult()) taskExtMapper.updateById(new BpmTaskExtDO().setId(taskExt.getId()).setResult(BpmProcessInstanceResultEnum.CANCEL.getResult())
.setEndTime(new Date()).setReason(BpmProcessInstanceDeleteReasonEnum.translateReason(task.getDeleteReason()))); .setEndTime(LocalDateTime.now()).setReason(BpmProcessInstanceDeleteReasonEnum.translateReason(task.getDeleteReason())));
} }
}); });

View File

@ -17,9 +17,9 @@ import org.springframework.context.annotation.Import;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildLocalDateTime;
import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId;
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NOT_EXISTS; import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.USER_GROUP_NOT_EXISTS;
@ -106,7 +106,7 @@ public class BpmUserGroupServiceTest extends BaseDbUnitTest {
BpmUserGroupDO dbUserGroup = RandomUtils.randomPojo(BpmUserGroupDO.class, o -> { // 等会查询到 BpmUserGroupDO dbUserGroup = RandomUtils.randomPojo(BpmUserGroupDO.class, o -> { // 等会查询到
o.setName("芋道源码"); o.setName("芋道源码");
o.setStatus(CommonStatusEnum.ENABLE.getStatus()); o.setStatus(CommonStatusEnum.ENABLE.getStatus());
o.setCreateTime(DateUtils.buildTime(2021, 11, 11)); o.setCreateTime(DateUtils.buildLocalDateTime(2021, 11, 11));
}); });
userGroupMapper.insert(dbUserGroup); userGroupMapper.insert(dbUserGroup);
// 测试 name 不匹配 // 测试 name 不匹配
@ -114,12 +114,12 @@ public class BpmUserGroupServiceTest extends BaseDbUnitTest {
// 测试 status 不匹配 // 测试 status 不匹配
userGroupMapper.insert(cloneIgnoreId(dbUserGroup, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); userGroupMapper.insert(cloneIgnoreId(dbUserGroup, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus())));
// 测试 createTime 不匹配 // 测试 createTime 不匹配
userGroupMapper.insert(cloneIgnoreId(dbUserGroup, o -> o.setCreateTime(DateUtils.buildTime(2021, 12, 12)))); userGroupMapper.insert(cloneIgnoreId(dbUserGroup, o -> o.setCreateTime(DateUtils.buildLocalDateTime(2021, 12, 12))));
// 准备参数 // 准备参数
BpmUserGroupPageReqVO reqVO = new BpmUserGroupPageReqVO(); BpmUserGroupPageReqVO reqVO = new BpmUserGroupPageReqVO();
reqVO.setName("源码"); reqVO.setName("源码");
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
reqVO.setCreateTime((new Date[]{buildTime(2021, 11, 10),buildTime(2021, 11, 12)})); reqVO.setCreateTime((new LocalDateTime[]{buildLocalDateTime(2021, 11, 10),buildLocalDateTime(2021, 11, 12)}));
// 调用 // 调用
PageResult<BpmUserGroupDO> pageResult = userGroupService.getUserGroupPage(reqVO); PageResult<BpmUserGroupDO> pageResult = userGroupService.getUserGroupPage(reqVO);

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.infra.api.logger.dto;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 访问日志 * API 访问日志
@ -61,12 +61,12 @@ public class ApiAccessLogCreateReqDTO {
* 开始请求时间 * 开始请求时间
*/ */
@NotNull(message = "开始请求时间不能为空") @NotNull(message = "开始请求时间不能为空")
private Date beginTime; private LocalDateTime beginTime;
/** /**
* 结束请求时间 * 结束请求时间
*/ */
@NotNull(message = "结束请求时间不能为空") @NotNull(message = "结束请求时间不能为空")
private Date endTime; private LocalDateTime endTime;
/** /**
* 执行时长单位毫秒 * 执行时长单位毫秒
*/ */

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.infra.api.logger.dto;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 错误日志 * API 错误日志
@ -61,7 +61,7 @@ public class ApiErrorLogCreateReqDTO {
* 异常时间 * 异常时间
*/ */
@NotNull(message = "异常时间不能为空") @NotNull(message = "异常时间不能为空")
private Date exceptionTime; private LocalDateTime exceptionTime;
/** /**
* 异常名 * 异常名
*/ */

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 代码生成字段定义 Response VO") @ApiModel("管理后台 - 代码生成字段定义 Response VO")
@Data @Data
@ -18,6 +18,6 @@ public class CodegenColumnRespVO extends CodegenColumnBaseVO {
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -26,6 +26,6 @@ public class CodegenTablePageReqVO extends PageParam {
@ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 代码生成表定义 Response VO") @ApiModel("管理后台 - 代码生成表定义 Response VO")
@Data @Data
@ -21,9 +21,9 @@ public class CodegenTableRespVO extends CodegenTableBaseVO {
private Integer dataSourceConfigId; private Integer dataSourceConfigId;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "更新时间", required = true) @ApiModelProperty(value = "更新时间", required = true)
private Date updateTime; private LocalDateTime updateTime;
} }

View File

@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 参数配置 Excel 导出响应 VO * 参数配置 Excel 导出响应 VO
@ -41,6 +41,6 @@ public class ConfigExcelVO {
private String remark; private String remark;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -24,6 +24,6 @@ public class ConfigExportReqVO {
@ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -29,6 +29,6 @@ public class ConfigPageReqVO extends PageParam {
@ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]") @ApiModelProperty(value = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 参数配置信息 Response VO") @ApiModel("管理后台 - 参数配置信息 Response VO")
@Data @Data
@ -26,6 +26,6 @@ public class ConfigRespVO extends ConfigBaseVO {
private Integer type; private Integer type;
@ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式")
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -1,7 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.db.vo; package cn.iocoder.yudao.module.infra.controller.admin.db.vo;
import lombok.*; import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ApiModel("管理后台 - 数据源配置 Response VO") @ApiModel("管理后台 - 数据源配置 Response VO")
@ -14,6 +15,6 @@ public class DataSourceConfigRespVO extends DataSourceConfigBaseVO {
private Integer id; private Integer id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -26,6 +26,6 @@ public class FileConfigPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 文件配置 Response VO") @ApiModel("管理后台 - 文件配置 Response VO")
@Data @Data
@ -31,6 +31,6 @@ public class FileConfigRespVO extends FileConfigBaseVO {
private FileClientConfig config; private FileClientConfig config;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -26,6 +26,6 @@ public class FilePageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -4,7 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel(value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大") @ApiModel(value = "管理后台 - 文件 Response VO", description = "不返回 content 字段,太大")
@Data @Data
@ -32,6 +32,6 @@ public class FileRespVO {
private Integer size; private Integer size;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -22,9 +22,9 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -133,7 +133,7 @@ public class JobController {
@ApiImplicitParam(name = "count", value = "数量", example = "5", dataTypeClass = Long.class) @ApiImplicitParam(name = "count", value = "数量", example = "5", dataTypeClass = Long.class)
}) })
@PreAuthorize("@ss.hasPermission('infra:job:query')") @PreAuthorize("@ss.hasPermission('infra:job:query')")
public CommonResult<List<Date>> getJobNextTimes(@RequestParam("id") Long id, public CommonResult<List<LocalDateTime>> getJobNextTimes(@RequestParam("id") Long id,
@RequestParam(value = "count", required = false, defaultValue = "5") Integer count) { @RequestParam(value = "count", required = false, defaultValue = "5") Integer count) {
JobDO job = jobService.getJob(id); JobDO job = jobService.getJob(id);
if (job == null) { if (job == null) {

View File

@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 定时任务 Excel VO * 定时任务 Excel VO
@ -36,21 +36,21 @@ public class JobExcelVO {
private String cronExpression; private String cronExpression;
@ExcelProperty("最后一次执行的开始时间") @ExcelProperty("最后一次执行的开始时间")
private Date executeBeginTime; private LocalDateTime executeBeginTime;
@ExcelProperty("最后一次执行的结束时间") @ExcelProperty("最后一次执行的结束时间")
private Date executeEndTime; private LocalDateTime executeEndTime;
@ExcelProperty("上一次触发时间") @ExcelProperty("上一次触发时间")
private Date firePrevTime; private LocalDateTime firePrevTime;
@ExcelProperty("下一次触发时间") @ExcelProperty("下一次触发时间")
private Date fireNextTime; private LocalDateTime fireNextTime;
@ExcelProperty("监控超时时间") @ExcelProperty("监控超时时间")
private Integer monitorTimeout; private Integer monitorTimeout;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -7,7 +7,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 定时任务 Response VO") @ApiModel("管理后台 - 定时任务 Response VO")
@Data @Data
@ -26,6 +26,6 @@ public class JobRespVO extends JobBaseVO {
private String handlerName; private String handlerName;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -5,7 +5,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -34,11 +34,11 @@ public class JobLogBaseVO {
@ApiModelProperty(value = "开始执行时间", required = true) @ApiModelProperty(value = "开始执行时间", required = true)
@NotNull(message = "开始执行时间不能为空") @NotNull(message = "开始执行时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginTime; private LocalDateTime beginTime;
@ApiModelProperty(value = "结束执行时间") @ApiModelProperty(value = "结束执行时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "执行时长", example = "123") @ApiModelProperty(value = "执行时长", example = "123")
private Integer duration; private Integer duration;

View File

@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 定时任务 Excel VO * 定时任务 Excel VO
@ -32,10 +32,10 @@ public class JobLogExcelVO {
private Integer executeIndex; private Integer executeIndex;
@ExcelProperty("开始执行时间") @ExcelProperty("开始执行时间")
private Date beginTime; private LocalDateTime beginTime;
@ExcelProperty("结束执行时间") @ExcelProperty("结束执行时间")
private Date endTime; private LocalDateTime endTime;
@ExcelProperty("执行时长") @ExcelProperty("执行时长")
private Integer duration; private Integer duration;
@ -48,6 +48,6 @@ public class JobLogExcelVO {
private String result; private String result;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -21,11 +21,11 @@ public class JobLogExportReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始执行时间") @ApiModelProperty(value = "开始执行时间")
private Date beginTime; private LocalDateTime beginTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束执行时间") @ApiModelProperty(value = "结束执行时间")
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举") @ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举")
private Integer status; private Integer status;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -26,11 +26,11 @@ public class JobLogPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始执行时间") @ApiModelProperty(value = "开始执行时间")
private Date beginTime; private LocalDateTime beginTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束执行时间") @ApiModelProperty(value = "结束执行时间")
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举") @ApiModelProperty(value = "任务状态", notes = "参见 JobLogStatusEnum 枚举")
private Integer status; private Integer status;

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - 定时任务日志 Response VO") @ApiModel("管理后台 - 定时任务日志 Response VO")
@Data @Data
@ -18,6 +18,6 @@ public class JobLogRespVO extends JobLogBaseVO {
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -5,7 +5,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -54,12 +54,12 @@ public class ApiAccessLogBaseVO {
@ApiModelProperty(value = "开始请求时间", required = true) @ApiModelProperty(value = "开始请求时间", required = true)
@NotNull(message = "开始请求时间不能为空") @NotNull(message = "开始请求时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date beginTime; private LocalDateTime beginTime;
@ApiModelProperty(value = "结束请求时间", required = true) @ApiModelProperty(value = "结束请求时间", required = true)
@NotNull(message = "结束请求时间不能为空") @NotNull(message = "结束请求时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date endTime; private LocalDateTime endTime;
@ApiModelProperty(value = "执行时长", required = true, example = "100") @ApiModelProperty(value = "执行时长", required = true, example = "100")
@NotNull(message = "执行时长不能为空") @NotNull(message = "执行时长不能为空")

View File

@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 访问日志 Excel VO * API 访问日志 Excel VO
@ -48,10 +48,10 @@ public class ApiAccessLogExcelVO {
private String userAgent; private String userAgent;
@ExcelProperty("开始请求时间") @ExcelProperty("开始请求时间")
private Date beginTime; private LocalDateTime beginTime;
@ExcelProperty("结束请求时间") @ExcelProperty("结束请求时间")
private Date endTime; private LocalDateTime endTime;
@ExcelProperty("执行时长") @ExcelProperty("执行时长")
private Integer duration; private Integer duration;

View File

@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -27,7 +27,7 @@ public class ApiAccessLogExportReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始请求时间") @ApiModelProperty(value = "开始请求时间")
private Date[] beginTime; private LocalDateTime[] beginTime;
@ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒") @ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒")
private Integer duration; private Integer duration;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -32,7 +32,7 @@ public class ApiAccessLogPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始请求时间") @ApiModelProperty(value = "开始请求时间")
private Date[] beginTime; private LocalDateTime[] beginTime;
@ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒") @ApiModelProperty(value = "执行时长", example = "100", notes = "大于等于,单位:毫秒")
private Integer duration; private Integer duration;

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - API 访问日志 Response VO") @ApiModel("管理后台 - API 访问日志 Response VO")
@Data @Data
@ -18,6 +18,6 @@ public class ApiAccessLogRespVO extends ApiAccessLogBaseVO {
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -5,7 +5,7 @@ import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -55,7 +55,7 @@ public class ApiErrorLogBaseVO {
@ApiModelProperty(value = "异常发生时间", required = true) @ApiModelProperty(value = "异常发生时间", required = true)
@NotNull(message = "异常发生时间不能为空") @NotNull(message = "异常发生时间不能为空")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date exceptionTime; private LocalDateTime exceptionTime;
@ApiModelProperty(value = "异常名", required = true) @ApiModelProperty(value = "异常名", required = true)
@NotNull(message = "异常名不能为空") @NotNull(message = "异常名不能为空")

View File

@ -6,7 +6,7 @@ import cn.iocoder.yudao.module.infra.enums.DictTypeConstants;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 错误日志 Excel VO * API 错误日志 Excel VO
@ -48,7 +48,7 @@ public class ApiErrorLogExcelVO {
private String userAgent; private String userAgent;
@ExcelProperty("异常发生时间") @ExcelProperty("异常发生时间")
private Date exceptionTime; private LocalDateTime exceptionTime;
@ExcelProperty("异常名") @ExcelProperty("异常名")
private String exceptionName; private String exceptionName;
@ -75,14 +75,14 @@ public class ApiErrorLogExcelVO {
private Integer exceptionLineNumber; private Integer exceptionLineNumber;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private Date createTime; private LocalDateTime createTime;
@ExcelProperty(value = "处理状态", converter = DictConvert.class) @ExcelProperty(value = "处理状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.API_ERROR_LOG_PROCESS_STATUS) @DictFormat(DictTypeConstants.API_ERROR_LOG_PROCESS_STATUS)
private Integer processStatus; private Integer processStatus;
@ExcelProperty("处理时间") @ExcelProperty("处理时间")
private Date processTime; private LocalDateTime processTime;
@ExcelProperty("处理用户编号") @ExcelProperty("处理用户编号")
private Integer processUserId; private Integer processUserId;

View File

@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -27,7 +27,7 @@ public class ApiErrorLogExportReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "异常发生时间") @ApiModelProperty(value = "异常发生时间")
private Date[] exceptionTime; private LocalDateTime[] exceptionTime;
@ApiModelProperty(value = "处理状态", example = "0") @ApiModelProperty(value = "处理状态", example = "0")
private Integer processStatus; private Integer processStatus;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -32,7 +32,7 @@ public class ApiErrorLogPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "异常发生时间") @ApiModelProperty(value = "异常发生时间")
private Date[] exceptionTime; private LocalDateTime[] exceptionTime;
@ApiModelProperty(value = "处理状态", example = "0") @ApiModelProperty(value = "处理状态", example = "0")
private Integer processStatus; private Integer processStatus;

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import java.util.Date; import java.time.LocalDateTime;
@ApiModel("管理后台 - API 错误日志 Response VO") @ApiModel("管理后台 - API 错误日志 Response VO")
@Data @Data
@ -18,10 +18,10 @@ public class ApiErrorLogRespVO extends ApiErrorLogBaseVO {
private Integer id; private Integer id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
@ApiModelProperty(value = "处理时间", required = true) @ApiModelProperty(value = "处理时间", required = true)
private Date processTime; private LocalDateTime processTime;
@ApiModelProperty(value = "处理用户编号", example = "233") @ApiModelProperty(value = "处理用户编号", example = "233")
private Integer processUserId; private Integer processUserId;

View File

@ -1,8 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.test.vo; package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
import lombok.*; import lombok.*;
import java.util.*;
import io.swagger.annotations.*; import java.time.LocalDateTime;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
@ -33,6 +33,6 @@ public class TestDemoExcelVO {
private String remark; private String remark;
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -1,9 +1,9 @@
package cn.iocoder.yudao.module.infra.controller.admin.test.vo; package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
import lombok.*; import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@ -29,6 +29,6 @@ public class TestDemoExportReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -1,7 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.test.vo; package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
import lombok.*; import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -31,6 +32,6 @@ public class TestDemoPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date[] createTime; private LocalDateTime[] createTime;
} }

View File

@ -1,7 +1,8 @@
package cn.iocoder.yudao.module.infra.controller.admin.test.vo; package cn.iocoder.yudao.module.infra.controller.admin.test.vo;
import lombok.*; import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ApiModel("管理后台 - 字典类型 Response VO") @ApiModel("管理后台 - 字典类型 Response VO")
@ -14,6 +15,6 @@ public class TestDemoRespVO extends TestDemoBaseVO {
private Long id; private Long id;
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private LocalDateTime createTime;
} }

View File

@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* 定时任务的执行日志 * 定时任务的执行日志
@ -56,11 +56,11 @@ public class JobLogDO extends BaseDO {
/** /**
* 开始执行时间 * 开始执行时间
*/ */
private Date beginTime; private LocalDateTime beginTime;
/** /**
* 结束执行时间 * 结束执行时间
*/ */
private Date endTime; private LocalDateTime endTime;
/** /**
* 执行时长单位毫秒 * 执行时长单位毫秒
*/ */

View File

@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 访问日志 * API 访问日志
@ -84,11 +84,11 @@ public class ApiAccessLogDO extends BaseDO {
/** /**
* 开始请求时间 * 开始请求时间
*/ */
private Date beginTime; private LocalDateTime beginTime;
/** /**
* 结束请求时间 * 结束请求时间
*/ */
private Date endTime; private LocalDateTime endTime;
/** /**
* 执行时长单位毫秒 * 执行时长单位毫秒
*/ */

View File

@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*; import lombok.*;
import java.util.Date; import java.time.LocalDateTime;
/** /**
* API 异常数据 * API 异常数据
@ -84,7 +84,7 @@ public class ApiErrorLogDO extends BaseDO {
/** /**
* 异常发生时间 * 异常发生时间
*/ */
private Date exceptionTime; private LocalDateTime exceptionTime;
/** /**
* 异常名 * 异常名
* *
@ -145,7 +145,7 @@ public class ApiErrorLogDO extends BaseDO {
/** /**
* 处理时间 * 处理时间
*/ */
private Date processTime; private LocalDateTime processTime;
/** /**
* 处理用户编号 * 处理用户编号
* *

View File

@ -1,12 +1,13 @@
package cn.iocoder.yudao.module.infra.dal.mysql.config; package cn.iocoder.yudao.module.infra.dal.mysql.config;
import cn.hutool.core.date.LocalDateTimeUtil;
import cn.iocoder.yudao.framework.apollo.internals.ConfigFrameworkDAO; import cn.iocoder.yudao.framework.apollo.internals.ConfigFrameworkDAO;
import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO; import cn.iocoder.yudao.framework.apollo.internals.dto.ConfigRespDTO;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.DriverManagerDataSource; import org.springframework.jdbc.datasource.DriverManagerDataSource;
import javax.sql.DataSource; import javax.sql.DataSource;
import java.util.Date; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
/** /**
@ -24,7 +25,7 @@ public class ConfigDAOImpl implements ConfigFrameworkDAO {
} }
@Override @Override
public int selectCountByUpdateTimeGt(Date maxUpdateTime) { public int selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime) {
return jdbcTemplate.queryForObject("SELECT COUNT(*) FROM infra_config WHERE update_time > ?", return jdbcTemplate.queryForObject("SELECT COUNT(*) FROM infra_config WHERE update_time > ?",
Integer.class, maxUpdateTime); Integer.class, maxUpdateTime);
} }
@ -34,7 +35,7 @@ public class ConfigDAOImpl implements ConfigFrameworkDAO {
return jdbcTemplate.query("SELECT config_key, value, update_time, deleted FROM infra_config", return jdbcTemplate.query("SELECT config_key, value, update_time, deleted FROM infra_config",
(rs, rowNum) -> new ConfigRespDTO().setKey(rs.getString("config_key")) (rs, rowNum) -> new ConfigRespDTO().setKey(rs.getString("config_key"))
.setValue(rs.getString("value")) .setValue(rs.getString("value"))
.setUpdateTime(rs.getDate("update_time")) .setUpdateTime(LocalDateTimeUtil.of(rs.getDate("update_time")))
.setDeleted(rs.getBoolean("deleted"))); .setDeleted(rs.getBoolean("deleted")));
} }

Some files were not shown because too many files have changed in this diff Show More