Browse Source

【CHG】统一修改日期时间格式

zhaomn 3 years ago
parent
commit
b1fc45744d

+ 2 - 2
railway-system/src/main/java/com/railway/system/domain/SysLogininfor.java

@@ -4,7 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import com.railway.common.annotation.Excel;
 import com.railway.common.annotation.Excel.ColumnType;
 import com.railway.common.core.domain.BaseEntity;
-import java.util.Date;
+import java.time.LocalDateTime;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -72,6 +72,6 @@ public class SysLogininfor extends BaseEntity {
    */
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
   @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
-  private Date loginTime;
+  private LocalDateTime loginTime;
 
 }

+ 2 - 2
railway-system/src/main/java/com/railway/system/domain/SysOperLog.java

@@ -5,7 +5,7 @@ import com.railway.common.annotation.Excel;
 import com.railway.common.annotation.Excel.ColumnType;
 import com.railway.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModelProperty;
-import java.util.Date;
+import java.time.LocalDateTime;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
@@ -136,6 +136,6 @@ public class SysOperLog extends BaseEntity {
   @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
   @ApiModelProperty(value = "操作时间")
   @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
-  private Date operTime;
+  private LocalDateTime operTime;
 
 }

+ 4 - 5
railway-system/src/main/java/com/railway/system/service/impl/SysScheduledTaskServiceImpl.java

@@ -4,12 +4,11 @@ import com.railway.common.utils.SecurityUtils;
 import com.railway.system.domain.SysScheduledTask;
 import com.railway.system.mapper.SysScheduledTaskMapper;
 import com.railway.system.service.ISysScheduledTaskService;
+import java.time.LocalDateTime;
+import java.util.List;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
-import java.util.List;
-
 /**
  * 系统计划任务表
  *
@@ -32,7 +31,7 @@ public class SysScheduledTaskServiceImpl implements ISysScheduledTaskService {
   @Override
   @Transactional(rollbackFor = Exception.class)
   public int create(SysScheduledTask sysScheduledTask) {
-    sysScheduledTask.setCreateTime(new Date());
+    sysScheduledTask.setCreateTime(LocalDateTime.now());
     sysScheduledTask.setCreateBy(SecurityUtils.getUserIdString());
     return sysScheduledTaskMapper.insert(sysScheduledTask);
   }
@@ -57,7 +56,7 @@ public class SysScheduledTaskServiceImpl implements ISysScheduledTaskService {
   @Override
   @Transactional(rollbackFor = Exception.class)
   public int update(SysScheduledTask sysScheduledTask) {
-    sysScheduledTask.setUpdateTime(new Date());
+    sysScheduledTask.setUpdateTime(LocalDateTime.now());
     sysScheduledTask.setUpdateBy(SecurityUtils.getUserIdString());
     return sysScheduledTaskMapper.update(sysScheduledTask);
   }