Browse Source

修改手机网站接口新增时间转换

anderx 7 years ago
parent
commit
92d7b686c7

+ 18 - 0
src/main/java/com/goafanti/demand/bo/AppDemandBo.java

@@ -3,6 +3,10 @@ package com.goafanti.demand.bo;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class AppDemandBo {
 	   private int fieldA;//行业
 	    private int fieldB;//行业二级
@@ -62,6 +66,13 @@ public class AppDemandBo {
 		public void setReleaseDate(Date releaseDate) {
 			this.releaseDate = releaseDate;
 		}
+		public String getReleaseDateFormattedDate() {
+			if (this.releaseDate == null) {
+				return null;
+			} else {
+				return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
+			}
+		}
 		public int getInterestCount() {
 			return interestCount;
 		}
@@ -152,6 +163,13 @@ public class AppDemandBo {
 		public void setCreateTime(Date createTime) {
 			this.createTime = createTime;
 		}
+		public String getCreateTimeFormattedDate() {
+			if (this.createTime == null) {
+				return null;
+			} else {
+				return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+			}
+		}
 		public String getPictureUrlMin() {
 			return pictureUrlMin;
 		}

+ 18 - 0
src/main/java/com/goafanti/message/bo/AppMessageBo.java

@@ -2,6 +2,10 @@ package com.goafanti.message.bo;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
 public class AppMessageBo {
 	private String id;
 	private String title;
@@ -45,5 +49,19 @@ public class AppMessageBo {
 	public void setSendTime(Date sendTime) {
 		this.sendTime = sendTime;
 	}
+	public String getSendTimeFormattedDate() {
+		if (this.sendTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getSendTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 	
 }

+ 17 - 1
src/main/java/com/goafanti/portal/bo/AchievementObject.java

@@ -3,7 +3,10 @@ package com.goafanti.portal.bo;
 
 import java.util.Date;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
 import com.goafanti.achievement.bo.InputAchievement;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.enums.AchievementCategory;
 import com.goafanti.common.enums.AchievementDataCategory;
 import com.goafanti.common.enums.Maturity;
@@ -58,6 +61,13 @@ public class AchievementObject extends InputAchievement {
 	public void setReleaseDate(Date releaseDate) {
 		this.releaseDate = releaseDate;
 	}
+	public String getReleaseDateFormattedDate() {
+		if (this.releaseDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}
 	public String getFieldAS() {
 		return fieldAS;
 	}
@@ -166,7 +176,13 @@ public class AchievementObject extends InputAchievement {
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
-	
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+		}
+	}