|
|
@@ -4,8 +4,12 @@ package com.uas.console.donate.model;
|
|
|
import javax.persistence.*;
|
|
|
import java.io.Serializable;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
+import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
|
|
|
+/**
|
|
|
+ * 项目实体
|
|
|
+ */
|
|
|
@Entity
|
|
|
@Table(name="donate$project")
|
|
|
public class Project implements Serializable{
|
|
|
@@ -36,9 +40,14 @@ public class Project implements Serializable{
|
|
|
|
|
|
/**
|
|
|
* 捐助领域
|
|
|
+ * 0:全部
|
|
|
+ * 1 环保/保护动物
|
|
|
+ * 2 疾病救助
|
|
|
+ * 3 扶贫/救灾
|
|
|
+ * 4 教育/助学
|
|
|
*/
|
|
|
@Column(name = "pro_area")
|
|
|
- private Integer area;
|
|
|
+ private String area;
|
|
|
|
|
|
/**
|
|
|
* 项目所在省
|
|
|
@@ -90,6 +99,12 @@ public class Project implements Serializable{
|
|
|
@Column(name = "pro_person_name")
|
|
|
private String personName;
|
|
|
|
|
|
+ /**
|
|
|
+ * 发起人电话号码
|
|
|
+ */
|
|
|
+ @Column(name = "pro_person_tel")
|
|
|
+ private String personTel;
|
|
|
+
|
|
|
/**
|
|
|
* 发起人头像
|
|
|
*/
|
|
|
@@ -128,7 +143,7 @@ public class Project implements Serializable{
|
|
|
private String detail;
|
|
|
|
|
|
/**
|
|
|
- * 核状态(0:待审核 1:批准 2:驳回)
|
|
|
+ * 审核核状态(0:待审核 1:批准 2:驳回)
|
|
|
*/
|
|
|
@Column(name = "pro_status")
|
|
|
private Integer status;
|
|
|
@@ -165,13 +180,13 @@ public class Project implements Serializable{
|
|
|
private Date submitTime;
|
|
|
|
|
|
/**
|
|
|
- * 驳回理由,true:正式发布,false:草稿状态
|
|
|
+ * 驳回理由
|
|
|
*/
|
|
|
@Column(name="pro_refuse")
|
|
|
private String refuse;
|
|
|
|
|
|
/**
|
|
|
- * 是否是提交状态
|
|
|
+ * 是否是提交状态 (1 为草稿 2为提交)
|
|
|
* @return
|
|
|
*/
|
|
|
@Column(name = "pro_publish")
|
|
|
@@ -185,6 +200,31 @@ public class Project implements Serializable{
|
|
|
@Column(name = "pro_total_amount")
|
|
|
private Double totalAmount;
|
|
|
|
|
|
+ /**
|
|
|
+ * 执行计划
|
|
|
+ */
|
|
|
+ @Column(name = "pro_executionplan")
|
|
|
+ private String executionPlan;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 资助人群
|
|
|
+ */
|
|
|
+ @Column(name = "pro_population")
|
|
|
+ private String population;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目已参与人数
|
|
|
+ */
|
|
|
+ @Column(name = "pro_join_amount")
|
|
|
+ private Long joinAmount;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 是否已结束 (1已过期,0未过期)
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transient
|
|
|
+ private Short overdue;
|
|
|
+
|
|
|
public Long getId() {
|
|
|
return id;
|
|
|
}
|
|
|
@@ -201,11 +241,11 @@ public class Project implements Serializable{
|
|
|
this.name = name;
|
|
|
}
|
|
|
|
|
|
- public Integer getArea() {
|
|
|
+ public String getArea() {
|
|
|
return area;
|
|
|
}
|
|
|
|
|
|
- public void setArea(Integer area) {
|
|
|
+ public void setArea(String area) {
|
|
|
this.area = area;
|
|
|
}
|
|
|
|
|
|
@@ -408,4 +448,67 @@ public class Project implements Serializable{
|
|
|
public void setTotalAmount(Double totalAmount) {
|
|
|
this.totalAmount = totalAmount;
|
|
|
}
|
|
|
+
|
|
|
+ @SuppressWarnings("deprecation")
|
|
|
+ public String getOverdue() {
|
|
|
+ if (null == startTime || null == endTime) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ Date date = new Date();
|
|
|
+ Calendar now = Calendar.getInstance();
|
|
|
+ now.set(Calendar.YEAR, date.getYear());
|
|
|
+ now.set(Calendar.MONTH, date.getMonth());
|
|
|
+ now.set(Calendar.DAY_OF_MONTH, date.getDate());
|
|
|
+ Calendar start = Calendar.getInstance();
|
|
|
+ start.set(Calendar.YEAR, startTime.getYear());
|
|
|
+ start.set(Calendar.MONTH, startTime.getMonth());
|
|
|
+ start.set(Calendar.DAY_OF_MONTH, startTime.getDate());
|
|
|
+ Calendar end = Calendar.getInstance();
|
|
|
+ end.set(Calendar.YEAR, endTime.getYear());
|
|
|
+ end.set(Calendar.MONTH, endTime.getMonth());
|
|
|
+ end.set(Calendar.DAY_OF_MONTH, endTime.getDate());
|
|
|
+ if (now.compareTo(start) >=0 && now.compareTo(end) <=0) {
|
|
|
+ return "执行中";
|
|
|
+ } else if(now.compareTo(start)<0){
|
|
|
+ return "筹备中";
|
|
|
+ }else{
|
|
|
+ return "已结束";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setOverdue(Short overdue) {
|
|
|
+ this.overdue = overdue;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getExecutionPlan() {
|
|
|
+ return executionPlan;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setExecutionPlan(String executionPlan) {
|
|
|
+ this.executionPlan = executionPlan;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPopulation() {
|
|
|
+ return population;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPopulation(String population) {
|
|
|
+ this.population = population;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getPersonTel() {
|
|
|
+ return personTel;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPersonTel(String personTel) {
|
|
|
+ this.personTel = personTel;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Long getJoinAmount() {
|
|
|
+ return joinAmount;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setJoinAmount(Long joinAmount) {
|
|
|
+ this.joinAmount = joinAmount;
|
|
|
+ }
|
|
|
}
|