fix:因为null导致无法leg状态回写
This commit is contained in:
parent
c1672a59a9
commit
b1add5a293
|
@ -436,11 +436,11 @@ public class Leg implements Serializable, EventManageable {
|
|||
public Leg restoreFromLegString(String legString) {
|
||||
String[] parts = legString.split("\\|");
|
||||
if (parts.length == 5) {
|
||||
this.startTime = parts[0] != null ? DateTimeUtil.strToTime(parts[0]) : null;
|
||||
this.endTime = parts[1] != null ? DateTimeUtil.strToTime(parts[1]) : null;
|
||||
this.originId = parts[2] != null ? Long.parseLong(parts[2]) : null;
|
||||
this.destinationId = parts[3] != null ? Long.parseLong(parts[3]) : null;
|
||||
this.estimateAmount = parts[4] != null ? parts[4] : null;
|
||||
this.startTime = parts[0] != null && !"null".equals(parts[0]) ? DateTimeUtil.strToTime(parts[0]) : null;
|
||||
this.endTime = parts[1] != null && !"null".equals(parts[1]) ? DateTimeUtil.strToTime(parts[1]) : null;
|
||||
this.originId = parts[2] != null && !"null".equals(parts[2]) ? Long.parseLong(parts[2]) : null;
|
||||
this.destinationId = parts[3] != null && !"null".equals(parts[3]) ? Long.parseLong(parts[3]) : null;
|
||||
this.estimateAmount = parts[4] != null && !"null".equals(parts[4]) ? parts[4] : null;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid legString format.");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue