Commit 66190627 by 丁伟峰

数据库中有好多字段是null,如果强行转换为toString会抛出异常。dto的Date类型,可以在返回json的时候,直接为null,或者日期?

1 parent f862892e
...@@ -2,6 +2,7 @@ package com.alibaba.cloud.integration.order.dto; ...@@ -2,6 +2,7 @@ package com.alibaba.cloud.integration.order.dto;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List; import java.util.List;
@lombok.Data @lombok.Data
...@@ -46,7 +47,7 @@ public class WorkbenchEngineersGanttRespDTO { ...@@ -46,7 +47,7 @@ public class WorkbenchEngineersGanttRespDTO {
/** /**
* 结束时间 * 结束时间
*/ */
private String endTime; private Date endTime;
/** /**
* 服务单ID * 服务单ID
*/ */
...@@ -58,7 +59,7 @@ public class WorkbenchEngineersGanttRespDTO { ...@@ -58,7 +59,7 @@ public class WorkbenchEngineersGanttRespDTO {
/** /**
* 开始时间 * 开始时间
*/ */
private String startTime; private Date startTime;
private List<?> tips; private List<?> tips;
} }
......
...@@ -82,7 +82,7 @@ public class WorkbenchServiceImpl implements WorkbenchService { ...@@ -82,7 +82,7 @@ public class WorkbenchServiceImpl implements WorkbenchService {
mapEngineers.put(entity.getEngineerCode(), new ArrayList<>()); mapEngineers.put(entity.getEngineerCode(), new ArrayList<>());
} }
WorkbenchEngineersGanttRespDTO.Timeline timeline = new WorkbenchEngineersGanttRespDTO.Timeline(); WorkbenchEngineersGanttRespDTO.Timeline timeline = new WorkbenchEngineersGanttRespDTO.Timeline();
timeline.setStartTime(entity.getStartTime().toString()).setEndTime(entity.getEndTime().toString()) timeline.setStartTime(entity.getStartTime()).setEndTime(entity.getEndTime())
.setServiceOrderId(entity.getOrderId()).setServiceOrderStatus(entity.getStatus()); .setServiceOrderId(entity.getOrderId()).setServiceOrderStatus(entity.getStatus());
timeline.setTips(getOrderTips(entity.getOrderId())); timeline.setTips(getOrderTips(entity.getOrderId()));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!