From e728c37b6424ade9bd7e28898bde6ff531015fe4 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 12 Nov 2024 13:07:43 +0800 Subject: [PATCH] add timezone --- .../main/java/com/ruoyi/common/core/domain/BaseEntity.java | 4 ++-- ruoyi-generator/src/main/resources/vm/java/domain.java.vm | 2 +- ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 67269ff6b..80c5b02f4 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -25,14 +25,14 @@ public class BaseEntity implements Serializable private String createBy; /** 创建时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createTime; /** 更新者 */ private String updateBy; /** 更新时间 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date updateTime; /** 备注 */ diff --git a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm index 4535e84ca..7805e271a 100644 --- a/ruoyi-generator/src/main/resources/vm/java/domain.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/domain.java.vm @@ -40,7 +40,7 @@ public class ${ClassName} extends ${Entity} #if($parentheseIndex != -1) @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") #elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") #else @Excel(name = "${comment}") diff --git a/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm b/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm index b5e308cf7..b00b85d7c 100644 --- a/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm +++ b/ruoyi-generator/src/main/resources/vm/java/sub-domain.java.vm @@ -31,7 +31,7 @@ public class ${subClassName} extends BaseEntity #if($parentheseIndex != -1) @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") #elseif($column.javaType == 'Date') - @JsonFormat(pattern = "yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd") #else @Excel(name = "${comment}")