|
@@ -1,7 +1,11 @@
|
|
package com.caimei.modules.order.entity;
|
|
package com.caimei.modules.order.entity;
|
|
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.regex.Matcher;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 单条物流信息展示
|
|
* 单条物流信息展示
|
|
@@ -10,10 +14,19 @@ public class LogisticsDetailVo {
|
|
|
|
|
|
private String time;
|
|
private String time;
|
|
private String desc;
|
|
private String desc;
|
|
|
|
+ private String context;
|
|
|
|
|
|
|
|
|
|
public String getTime() {
|
|
public String getTime() {
|
|
- return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(Long.valueOf(time + "000")));
|
|
|
|
|
|
+ Pattern pattern = Pattern.compile("[0-9]{1,}");
|
|
|
|
+ Matcher matcher = pattern.matcher((CharSequence) time);
|
|
|
|
+ boolean result=matcher.matches();
|
|
|
|
+ if (result == true) {
|
|
|
|
+ return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(Long.valueOf(time + "000")));
|
|
|
|
+ }else{
|
|
|
|
+ return time;
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void setTime(String time) {
|
|
public void setTime(String time) {
|
|
@@ -21,10 +34,26 @@ public class LogisticsDetailVo {
|
|
}
|
|
}
|
|
|
|
|
|
public String getDesc() {
|
|
public String getDesc() {
|
|
- return desc;
|
|
|
|
|
|
+ if(StringUtils.isEmpty(desc)){
|
|
|
|
+ return context;
|
|
|
|
+ } else {
|
|
|
|
+ return desc;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void setDesc(String desc) {
|
|
public void setDesc(String desc) {
|
|
this.desc = desc;
|
|
this.desc = desc;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public String getContext() {
|
|
|
|
+ if(StringUtils.isEmpty(context)){
|
|
|
|
+ return desc;
|
|
|
|
+ } else {
|
|
|
|
+ return context;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setContext(String context) {
|
|
|
|
+ this.context = context;
|
|
|
|
+ }
|
|
}
|
|
}
|