Activity.java 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. package com.goafanti.common.model;
  2. import java.util.Date;
  3. import org.apache.commons.lang3.time.DateFormatUtils;
  4. import com.fasterxml.jackson.annotation.JsonFormat;
  5. import com.fasterxml.jackson.annotation.JsonFormat.Shape;
  6. import com.goafanti.common.constant.AFTConstants;
  7. import com.goafanti.common.enums.ActivityStatus;
  8. import com.fasterxml.jackson.annotation.JsonIgnore;
  9. public class Activity {
  10. private Long id;
  11. /**
  12. * 开始时间
  13. */
  14. private Date startTime;
  15. /**
  16. * 结束时间
  17. */
  18. private Date endTime;
  19. /**
  20. * 标题
  21. */
  22. private String name;
  23. /**
  24. * 状态
  25. */
  26. private Integer status;
  27. /**
  28. * 活动地址
  29. */
  30. private String address;
  31. /**
  32. * 主办单位
  33. */
  34. private String host;
  35. /**
  36. * 承办单位
  37. */
  38. private String undertake;
  39. /**
  40. * 协办单位,逗号隔开
  41. */
  42. private String asist;
  43. /**
  44. * 活动类型
  45. */
  46. private Integer type;
  47. /**
  48. * 活动形式
  49. */
  50. private Integer form;
  51. /**
  52. * 活动图片地址
  53. */
  54. private String imgUrls;
  55. /**
  56. * 活动结果描述
  57. */
  58. private String result;
  59. /**
  60. * 创建时间(报名开始时间)
  61. */
  62. private Date createTime;
  63. /**
  64. * 报名截止时间
  65. */
  66. private Date enrollDeadline;
  67. /**
  68. * 题图地址
  69. */
  70. private String titleUrl;
  71. /**
  72. * 描述
  73. */
  74. private String summary;
  75. @JsonFormat(shape = Shape.STRING)
  76. public Long getId() {
  77. return id;
  78. }
  79. public void setId(Long id) {
  80. this.id = id;
  81. }
  82. public Date getStartTime() {
  83. return startTime;
  84. }
  85. public void setStartTime(Date startTime) {
  86. this.startTime = startTime;
  87. }
  88. public Date getEndTime() {
  89. return endTime;
  90. }
  91. public void setEndTime(Date endTime) {
  92. this.endTime = endTime;
  93. }
  94. public String getName() {
  95. return name;
  96. }
  97. public void setName(String name) {
  98. this.name = name;
  99. }
  100. public Integer getStatus() {
  101. return status;
  102. }
  103. public void setStatus(Integer status) {
  104. this.status = status;
  105. }
  106. public String getAddress() {
  107. return address;
  108. }
  109. public void setAddress(String address) {
  110. this.address = address;
  111. }
  112. public String getHost() {
  113. return host;
  114. }
  115. public void setHost(String host) {
  116. this.host = host;
  117. }
  118. public String getUndertake() {
  119. return undertake;
  120. }
  121. public void setUndertake(String undertake) {
  122. this.undertake = undertake;
  123. }
  124. public String getAsist() {
  125. return asist;
  126. }
  127. public void setAsist(String asist) {
  128. this.asist = asist;
  129. }
  130. @JsonFormat(shape = Shape.STRING)
  131. public Integer getType() {
  132. return type;
  133. }
  134. public void setType(Integer type) {
  135. this.type = type;
  136. }
  137. @JsonFormat(shape = Shape.STRING)
  138. public Integer getForm() {
  139. return form;
  140. }
  141. public void setForm(Integer form) {
  142. this.form = form;
  143. }
  144. public String getImgUrls() {
  145. return imgUrls;
  146. }
  147. public void setImgUrls(String imgUrls) {
  148. this.imgUrls = imgUrls;
  149. }
  150. public String getResult() {
  151. return result;
  152. }
  153. public void setResult(String result) {
  154. this.result = result;
  155. }
  156. @JsonIgnore
  157. public Date getCreateTime() {
  158. return createTime;
  159. }
  160. public void setCreateTime(Date createTime) {
  161. this.createTime = createTime;
  162. }
  163. public Date getEnrollDeadline() {
  164. return enrollDeadline;
  165. }
  166. public void setEnrollDeadline(Date enrollDeadline) {
  167. this.enrollDeadline = enrollDeadline;
  168. }
  169. public String getTitleUrl() {
  170. return titleUrl;
  171. }
  172. public void setTitleUrl(String titleUrl) {
  173. this.titleUrl = titleUrl;
  174. }
  175. public String getSummary() {
  176. return summary;
  177. }
  178. public void setSummary(String summary) {
  179. this.summary = summary;
  180. }
  181. public String getStartTimeFormattedDate() {
  182. if (this.startTime == null) {
  183. return null;
  184. } else {
  185. return DateFormatUtils.format(this.startTime, AFTConstants.YYYYMMDDHHMMSS);
  186. }
  187. }
  188. public void setStartTimeFormattedDate(String startTimeFormattedDate) {
  189. }
  190. public String getEndTimeFormattedDate() {
  191. if (this.endTime == null) {
  192. return null;
  193. } else {
  194. return DateFormatUtils.format(this.endTime, AFTConstants.YYYYMMDDHHMMSS);
  195. }
  196. }
  197. public void setEndTimeFormattedDate(String endTimeFormattedDate) {
  198. }
  199. public String getEnrollDeadlineFormattedDate() {
  200. if (this.enrollDeadline == null) {
  201. return null;
  202. } else {
  203. return DateFormatUtils.format(this.enrollDeadline, AFTConstants.YYYYMMDDHHMMSS);
  204. }
  205. }
  206. public void setEnrollDeadlineFormattedDate(String enrollDeadlineFormattedDate) {
  207. }
  208. public Integer getActivityStatus(){
  209. if (this.enrollDeadline == null){
  210. return ActivityStatus.ENROLL.getCode();
  211. }
  212. if (new Date().getTime() > this.enrollDeadline.getTime()){
  213. return ActivityStatus.CLOSED.getCode();
  214. }
  215. return ActivityStatus.ENROLL.getCode();
  216. }
  217. public void setActivityStatus(Integer activityStatus){
  218. }
  219. }