浏览代码

json格式化时间设置时区

陈长荣 3 月之前
父节点
当前提交
dfb044f973

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/flow/dto/FlowAuditDto.java

@@ -43,6 +43,6 @@ public class FlowAuditDto {
 
     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;
 }

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/flow/dto/FlowPageDto.java

@@ -58,7 +58,7 @@ public class FlowPageDto {
     private String createBy;
 
     @Schema(description = "申请日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
     private Date createTime;
 
     @Schema(description = "申请人")

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/flow/entity/FlowFileVersion.java

@@ -70,7 +70,7 @@ public class FlowFileVersion extends Model implements Serializable {
      * 创建时间
      */
     @TableField(fill = FieldFill.INSERT)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
     private Date createTime;
 
     private static final long serialVersionUID = 1L;

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/dto/SampleAuditDto.java

@@ -32,6 +32,6 @@ public class SampleAuditDto {
 
     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;
 }

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/dto/SamplePageDto.java

@@ -49,7 +49,7 @@ public class SamplePageDto {
     private String approvalNo;
 
     @Schema(description = "申请时间")
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
     private LocalDateTime applyTime;
 
     /**

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/vo/CommissionVo.java

@@ -45,7 +45,7 @@ public class CommissionVo {
     private String reportAddress;
 
     @Schema(description = "送检日期", example = "yyyy-MM-dd")
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
     private LocalDate submitDate;
 
     @Schema(description = "扩展字段(json字符串)")

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/vo/SampleCheckOrderVo.java

@@ -37,7 +37,7 @@ public class SampleCheckOrderVo {
      * 申请日期
      */
     @Schema(description = "申请日期", hidden = true)
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
     private Date applyDate;
 
     /**

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/vo/SampleCheckSerumVo.java

@@ -37,7 +37,7 @@ public class SampleCheckSerumVo {
      * 申请日期
      */
     @Schema(description = "申请日期", hidden = true)
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
     private Date applyDate;
 
     /**

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/vo/SampleFoodDetailVo.java

@@ -15,7 +15,7 @@ public class SampleFoodDetailVo {
     @Schema(description = "生产商")
     private String manufacturer;
 
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
     @Schema(description = "生产日期")
     private Date productionDate;
 

+ 1 - 1
jfcloud-gene-biz/src/main/java/com/github/jfcloud/gene/sample/vo/SampleSubmitVo.java

@@ -48,7 +48,7 @@ public class SampleSubmitVo {
     private String receiveUserName;
 
     @Schema(description = "申请时间", example = "2022-01-01")
-    @JsonFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
     private LocalDate applyTime;
 
     @Schema(description = "检测人员", example = "[{\"id\":1,\"name\":\"张三\"},{\"id\":2,\"name\":\"李四\"}]")

+ 2 - 2
jfcloud-gene-common/src/main/java/com/github/jfcloud/gene/common/entity/BaseEntity.java

@@ -25,11 +25,11 @@ public abstract class BaseEntity extends Model implements Serializable {
     private Long deptId;
 
     @TableField(fill = FieldFill.INSERT)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
     private Date createTime;
 
     @TableField(fill = FieldFill.INSERT_UPDATE)
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
     private Date updateTime;
 
     @TableField(fill = FieldFill.INSERT)