diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialMainVO.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialMainVO.java index 0c8ffbf9..b7d64eda 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialMainVO.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/pojo/vo/MaterialMainVO.java @@ -304,6 +304,7 @@ public class MaterialMainVO implements Serializable { @ApiModelProperty(value = "变更审请人") private String updatedByUserCode; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime lastApplyTime; /** @@ -323,6 +324,7 @@ public class MaterialMainVO implements Serializable { * 创建时间 */ @ApiModelProperty(value = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime createdTime; /** @@ -335,6 +337,7 @@ public class MaterialMainVO implements Serializable { * 更新时间 */ @ApiModelProperty(value = "更新时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private LocalDateTime updatedTime; /** diff --git a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java index 9cd8b8a0..89292981 100644 --- a/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java +++ b/nflg_project_dev/material/src/main/java/com/nflg/product/material/service/MaterialMainService.java @@ -62,6 +62,7 @@ import java.math.RoundingMode; import java.nio.file.Path; import java.nio.file.Paths; import java.sql.*; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.ZoneId; @@ -221,6 +222,7 @@ public class MaterialMainService extends ServiceImpl 0) { initMaterialAttrsMapForPageList(result, childList); + formatTimeField(result); } dataResult.setRecords(result); @@ -237,6 +239,25 @@ public class MaterialMainService extends ServiceImpl> result) { + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + result.forEach(item -> { + if (ObjectUtil.isNotEmpty(item.get("createdTime"))) { + item.put("createdTime", formatter.format((Timestamp) item.get("createdTime"))); + } + if (ObjectUtil.isNotEmpty(item.get("updatedTime"))) { + item.put("updatedTime", formatter.format((Timestamp) item.get("updatedTime"))); + } + if (ObjectUtil.isNotEmpty(item.get("lastApplyTime"))) { + item.put("lastApplyTime", formatter.format((Timestamp) item.get("lastApplyTime"))); + } + }); + } + /** * 获取总页数 *