fix 修复 warmflow 时间用的还是Date类 导致无法注入数据问题
This commit is contained in:
+5
@@ -12,6 +12,7 @@ import org.dromara.common.satoken.utils.LoginHelper;
|
|||||||
import org.dromara.system.api.model.LoginUser;
|
import org.dromara.system.api.model.LoginUser;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MP注入处理器
|
* MP注入处理器
|
||||||
@@ -61,6 +62,9 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
|||||||
LocalDateTime date = LocalDateTime.now();
|
LocalDateTime date = LocalDateTime.now();
|
||||||
this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, date);
|
this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, date);
|
||||||
this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, date);
|
this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, date);
|
||||||
|
Date legacyDate = new Date();
|
||||||
|
this.strictInsertFill(metaObject, "createTime", Date.class, legacyDate);
|
||||||
|
this.strictInsertFill(metaObject, "updateTime", Date.class, legacyDate);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_INTERNAL_ERROR);
|
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_INTERNAL_ERROR);
|
||||||
@@ -86,6 +90,7 @@ public class InjectionMetaObjectHandler implements MetaObjectHandler {
|
|||||||
baseEntity.setUpdateBy(userId);
|
baseEntity.setUpdateBy(userId);
|
||||||
} else {
|
} else {
|
||||||
this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
|
this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
|
||||||
|
this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_INTERNAL_ERROR);
|
throw new ServiceException("自动注入异常 => " + e.getMessage(), HttpStatus.HTTP_INTERNAL_ERROR);
|
||||||
|
|||||||
Reference in New Issue
Block a user