1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package com.caimei.modules.order.entity;
- import org.apache.commons.lang3.StringUtils;
- import java.text.SimpleDateFormat;
- import java.util.Date;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- /**
- * 单条物流信息展示
- */
- public class LogisticsDetailVo {
- private String time;
- private String desc;
- private String context;
- public String getTime() {
- 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) {
- this.time = time;
- }
- public String getDesc() {
- if(StringUtils.isEmpty(desc)){
- return context;
- } else {
- return desc;
- }
- }
- public void setDesc(String desc) {
- this.desc = desc;
- }
- public String getContext() {
- if(StringUtils.isEmpty(context)){
- return desc;
- } else {
- return context;
- }
- }
- public void setContext(String context) {
- this.context = context;
- }
- }
|