Commit 6dc6ddac by huangjinxin

fix:时间返回优化

1 parent 3ec3f5eb
package com.dituhui.pea.order.common;
import cn.hutool.core.util.ObjectUtil;
import java.sql.Timestamp;
import java.time.LocalDate;
import java.time.LocalDateTime;
......@@ -49,6 +51,9 @@ public class TimeUtils {
}
public static final String IsoLocalDateTime2String(LocalDateTime localDateTime) {
if (ObjectUtil.isNull(localDateTime)) {
return null;
}
return localDateTime.format(DateTimeFormatter.ofPattern(DATE_TIME_FORMAT));
}
......
......@@ -113,22 +113,22 @@ public class OrderServiceDetailResp {
/**
* 计划开始时间
*/
private LocalDateTime planStartTime;
private String planStartTime;
/**
* 计划结束时间
*/
private LocalDateTime planEndTime;
private String planEndTime;
/**
* 开始服务时间
*/
private LocalDateTime actualStartTime;
private String actualStartTime;
/**
* 结束服务时间
*/
private LocalDateTime actualEndTime;
private String actualEndTime;
//
// @Data
// @JsonInclude(JsonInclude.Include.NON_NULL)
......
......@@ -117,10 +117,10 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
res.setBeanTags(order.getBeanTags());
res.setTranscend(order.getTranscend());
res.setEngineerCodeSub(order.getEngineerCodeSub());
res.setPlanStartTime(order.getPlanStartTime());
res.setPlanEndTime(order.getPlanEndTime());
res.setActualStartTime(order.getActualStartTime());
res.setActualEndTime(order.getActualEndTime());
res.setPlanStartTime(TimeUtils.IsoLocalDateTime2String(order.getPlanStartTime()));
res.setPlanEndTime(TimeUtils.IsoLocalDateTime2String(order.getPlanEndTime()));
res.setActualStartTime(TimeUtils.IsoLocalDateTime2String(order.getActualStartTime()));
res.setActualEndTime(TimeUtils.IsoLocalDateTime2String(order.getActualEndTime()));
return Result.success(res);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!