Commit d522ad90 by 丁伟峰

数据库中,datetime/timestamp,java这边统一使用新的LocalDateTime来处理

1 parent 6a5c493a
......@@ -2,7 +2,7 @@ package com.dituhui.pea.order.dto;
import lombok.experimental.Accessors;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.List;
@lombok.Data
......@@ -21,7 +21,7 @@ public class CapacityStatQueryRespDTO {
private long capAdjust;
private long capTotal;
private long capUsed;
private Date updateTime;
private LocalDateTime updateTime;
private String date;
private long engineerNum;
private String levelType;
......
......@@ -3,7 +3,7 @@ package com.dituhui.pea.order.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.experimental.Accessors;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.List;
@lombok.Data
......@@ -66,12 +66,12 @@ public class EngineersGanttRespDTO {
* 开始时间
*/
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
private LocalDateTime startTime;
/**
* 结束时间
*/
// @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
private LocalDateTime endTime;
/**
* 鼠标悬停提示
*/
......
......@@ -3,7 +3,7 @@ package com.dituhui.pea.order.dto;
import com.dituhui.pea.order.config.OrderConfig;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.time.LocalDateTime;
@lombok.Data
public class OrderChangeListReqDTO {
......@@ -18,7 +18,7 @@ public class OrderChangeListReqDTO {
private int page = OrderConfig.DEFAULT_PAGE_INDEX;
private int size = OrderConfig.DEFAULT_PAGE_SIZE;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date date = new Date();
private LocalDateTime date = LocalDateTime.now();
/**
* 排序
*/
......
......@@ -3,7 +3,8 @@ package com.dituhui.pea.order.entity;
import lombok.Data;
import javax.persistence.*;
import java.util.Date;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@Entity
......@@ -58,25 +59,30 @@ public class OrderAppointmentEntity {
private Integer isWorkshop;
/**
* 预约日期
*/
private LocalDate dt;
/**
* 客户预约上门时间
*/
private Date expectStartTime;
private LocalDateTime expectStartTime;
private Date expectEndTime;
private LocalDateTime expectEndTime;
/**
* 实际上门时间
*/
private Date actualTime;
private LocalDateTime actualTime;
/**
* 开始服务时间
*/
private Date actualStartTime;
private LocalDateTime actualStartTime;
/**
* 结束服务时间
*/
private Date actualEndTime;
private LocalDateTime actualEndTime;
/**
* pre-预排班/confirm-已确认
......@@ -96,11 +102,11 @@ public class OrderAppointmentEntity {
/**
* 创建时间
*/
private Date createTime;
private LocalDateTime createTime;
/**
* 更新时间
*/
private Date updateTime;
private LocalDateTime updateTime;
}
......@@ -19,7 +19,8 @@ package com.dituhui.pea.order.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Entity
@Data
......@@ -43,8 +44,9 @@ public class OrderRequestEntity {
private String skill;
private String applyNote;
private String faultDescribe;
private String expectTimeBegin;
private String expectTimeEnd;
private LocalDate dt;
private LocalDateTime expectTimeBegin;
private LocalDateTime expectTimeEnd;
private String expectTimeDesc;
private String source;
private String areaId;
......@@ -64,6 +66,6 @@ public class OrderRequestEntity {
private String orgTeamId;
private String orgTeamName;
private String description;
private String createTime;
private String updateTime;
private LocalDateTime createTime;
private LocalDateTime updateTime;
}
......@@ -36,6 +36,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
......@@ -100,10 +102,11 @@ public class OrderCreateServiceImpl implements OrderCreateService {
entity.setSkill(req.getSkill());
entity.setFaultDescribe(req.getFaultDescribe());
entity.setExpectTimeBegin(req.getExpectBegin());
entity.setExpectTimeEnd(req.getExpectEnd());
entity.setExpectTimeBegin(LocalDateTime.parse(req.getExpectBegin()));
entity.setExpectTimeEnd(LocalDateTime.parse(req.getExpectEnd()));
entity.setExpectTimeDesc(req.getExpectDesc());
entity.setDescription(req.getDescription());
entity.setDt(LocalDate.parse(req.getExpectBegin()));
// location
LocationDTO location = req.getLocation();
entity.setProvince(location.getProvince());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!