refactor(domain): 优化班次时间字段类型
- 将 startTime、endTime、startTime2、endTime2 字段从 Date 类型改为 LocalTime 类型 - 为所有时间字段添加 @JsonFormat 注解以支持 HH:mm:ss 格式 - 为所有时间字段添加 @DateTimeFormat 注解以支持表单绑定 - 更新 WmsAttendanceShift、WmsAttendanceShiftBo 和 WmsAttendanceShiftVo 三个类的时间字段定义 - 移除旧的 java.util.Date 导入并添加 java.time.LocalTime 导入 - 添加对 Spring DateTimeFormat 注解的支持导入
This commit is contained in:
@@ -6,8 +6,9 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.time.LocalTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 班次对象 wms_attendance_shift
|
||||
@@ -42,19 +43,27 @@ public class WmsAttendanceShift extends BaseEntity {
|
||||
/**
|
||||
* 上班1
|
||||
*/
|
||||
private Date startTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime startTime;
|
||||
/**
|
||||
* 下班1
|
||||
*/
|
||||
private Date endTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime endTime;
|
||||
/**
|
||||
* 上班2
|
||||
*/
|
||||
private Date startTime2;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime startTime2;
|
||||
/**
|
||||
* 下班2
|
||||
*/
|
||||
private Date endTime2;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime endTime2;
|
||||
/**
|
||||
* 是否跨天
|
||||
*/
|
||||
|
||||
@@ -6,8 +6,9 @@ import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.time.LocalTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 班次业务对象 wms_attendance_shift
|
||||
@@ -43,22 +44,30 @@ public class WmsAttendanceShiftBo extends BaseEntity {
|
||||
/**
|
||||
* 上班1
|
||||
*/
|
||||
private Date startTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime startTime;
|
||||
|
||||
/**
|
||||
* 下班1
|
||||
*/
|
||||
private Date endTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* 上班2
|
||||
*/
|
||||
private Date startTime2;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime startTime2;
|
||||
|
||||
/**
|
||||
* 下班2
|
||||
*/
|
||||
private Date endTime2;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime endTime2;
|
||||
|
||||
/**
|
||||
* 是否跨天
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.time.LocalTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
@@ -53,25 +54,33 @@ public class WmsAttendanceShiftVo {
|
||||
* 上班1
|
||||
*/
|
||||
@ExcelProperty(value = "上班1")
|
||||
private Date startTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime startTime;
|
||||
|
||||
/**
|
||||
* 下班1
|
||||
*/
|
||||
@ExcelProperty(value = "下班1")
|
||||
private Date endTime;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* 上班2
|
||||
*/
|
||||
@ExcelProperty(value = "上班2")
|
||||
private Date startTime2;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime startTime2;
|
||||
|
||||
/**
|
||||
* 下班2
|
||||
*/
|
||||
@ExcelProperty(value = "下班2")
|
||||
private Date endTime2;
|
||||
@JsonFormat(pattern = "HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "HH:mm:ss")
|
||||
private LocalTime endTime2;
|
||||
|
||||
/**
|
||||
* 是否跨天
|
||||
|
||||
Reference in New Issue
Block a user