活动子系统三次完善
This commit is contained in:
parent
cb15f6608c
commit
60356b46fa
2
pom.xml
2
pom.xml
@ -111,7 +111,7 @@
|
|||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.16.10</version>
|
<version>1.16.10</version>
|
||||||
</dependency>
|
</dependency>s
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -3,9 +3,7 @@ package com.codesdream.ase.component;
|
|||||||
import com.codesdream.ase.model.permission.Tag;
|
import com.codesdream.ase.model.permission.Tag;
|
||||||
import com.codesdream.ase.model.permission.User;
|
import com.codesdream.ase.model.permission.User;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import sun.nio.cs.US_ASCII;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class Activity {
|
|||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String creator;
|
private String creator;
|
||||||
|
|
||||||
//活动类型1qa
|
//活动类型
|
||||||
@Column(nullable = false)
|
@Column(nullable = false)
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ -41,6 +41,10 @@ public class Activity {
|
|||||||
@Column(nullable = true)
|
@Column(nullable = true)
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
//活动周期,格式:阿拉伯数字数字+单位,0表示无周期
|
||||||
|
@Column(nullable = true)
|
||||||
|
private String cycle;
|
||||||
|
|
||||||
//自愿参与人列表
|
//自愿参与人列表
|
||||||
@ManyToMany(cascade = CascadeType.ALL)
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
@JoinTable(name = "act_volunteer")
|
@JoinTable(name = "act_volunteer")
|
||||||
@ -94,7 +98,7 @@ public class Activity {
|
|||||||
)
|
)
|
||||||
private Set<User> signedGroup;
|
private Set<User> signedGroup;
|
||||||
|
|
||||||
//可见人员人员列表
|
//可见人员列表
|
||||||
@ManyToMany(cascade = CascadeType.ALL)
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
@JoinTable(name = "act_vis",
|
@JoinTable(name = "act_vis",
|
||||||
joinColumns = {
|
joinColumns = {
|
||||||
@ -132,12 +136,10 @@ public class Activity {
|
|||||||
|
|
||||||
//计划开始时间
|
//计划开始时间
|
||||||
@OneToOne(cascade = CascadeType.ALL)
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "plan_period")
|
|
||||||
private Period planPeriod;
|
private Period planPeriod;
|
||||||
|
|
||||||
//实际开始时间
|
//实际开始时间
|
||||||
@OneToOne(cascade = CascadeType.ALL)
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "real_period")
|
|
||||||
private Period realPeriod;
|
private Period realPeriod;
|
||||||
|
|
||||||
//提前提醒时间
|
//提前提醒时间
|
||||||
@ -150,7 +152,7 @@ public class Activity {
|
|||||||
|
|
||||||
//主要负责人
|
//主要负责人
|
||||||
@OneToOne(cascade = CascadeType.ALL)
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
@JoinColumn(name = "chief_manager", nullable = false)
|
@JoinColumn(nullable = false)
|
||||||
private User chiefManager;
|
private User chiefManager;
|
||||||
|
|
||||||
//次要负责人
|
//次要负责人
|
||||||
@ -168,7 +170,9 @@ public class Activity {
|
|||||||
|
|
||||||
//考勤安排
|
//考勤安排
|
||||||
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
@JoinColumn(name = "attendance")
|
|
||||||
private Attendance attendance;
|
private Attendance attendance;
|
||||||
|
|
||||||
|
//活动报告
|
||||||
|
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
private Report report;
|
||||||
}
|
}
|
@ -24,8 +24,7 @@ public class Attendance {
|
|||||||
private boolean isOnline;
|
private boolean isOnline;
|
||||||
|
|
||||||
//打卡时段列表
|
//打卡时段列表
|
||||||
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "attendance")
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
@JoinColumn(name = "a_id")
|
|
||||||
private Set<Period> clockInPeriods;
|
private Set<Period> clockInPeriods;
|
||||||
|
|
||||||
//打卡方式,0表示被扫,1表示扫
|
//打卡方式,0表示被扫,1表示扫
|
||||||
|
178
src/main/java/com/codesdream/ase/model/activity/Report.java
Normal file
178
src/main/java/com/codesdream/ase/model/activity/Report.java
Normal file
@ -0,0 +1,178 @@
|
|||||||
|
package com.codesdream.ase.model.activity;
|
||||||
|
|
||||||
|
import com.codesdream.ase.model.permission.User;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@Table(name = "report",
|
||||||
|
indexes = {
|
||||||
|
@Index(name = "report_index1", columnList = "title"),
|
||||||
|
@Index(name = "report_index2", columnList = "creator")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
public class Report {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
//活动标题
|
||||||
|
@Column(nullable = false, unique = true)
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
//创建人
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
//活动类型
|
||||||
|
@Column(nullable = false)
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
//活动描述
|
||||||
|
@Column(nullable = true)
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
//活动周期,格式:阿拉伯数字数字+单位,0表示无周期
|
||||||
|
@Column(nullable = true)
|
||||||
|
private String cycle;
|
||||||
|
|
||||||
|
//自愿参与人列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_volunteer")
|
||||||
|
private Set<User> volunteers;
|
||||||
|
|
||||||
|
//参与人列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_participate",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "participate_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> participateGroup;
|
||||||
|
|
||||||
|
//实际参与人列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_participated",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id" )
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "participated_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> participatedGroup;
|
||||||
|
|
||||||
|
//可报名人员列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_sign",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "sign_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> signGroup;
|
||||||
|
|
||||||
|
//已报名人员列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_signed",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "signed_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> signedGroup;
|
||||||
|
|
||||||
|
//可见人员列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_vis",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "vis_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> visibleGroup;
|
||||||
|
|
||||||
|
//通知人员列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_inform",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "inform_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> informGroup;
|
||||||
|
|
||||||
|
//已通知人员列表
|
||||||
|
@ManyToMany(cascade = CascadeType.ALL)
|
||||||
|
@JoinTable(name = "act_informed",
|
||||||
|
joinColumns = {
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
},
|
||||||
|
inverseJoinColumns = {
|
||||||
|
@JoinColumn(name = "informed_id")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
private Set<User> informedGroup;
|
||||||
|
|
||||||
|
//计划开始时间
|
||||||
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
|
@JoinColumn(name = "plan_period")
|
||||||
|
private Period planPeriod;
|
||||||
|
|
||||||
|
//实际开始时间
|
||||||
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
|
@JoinColumn(name = "real_period")
|
||||||
|
private Period realPeriod;
|
||||||
|
|
||||||
|
//主要负责人
|
||||||
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
|
@JoinColumn(name = "chief_manager", nullable = false)
|
||||||
|
private User chiefManager;
|
||||||
|
|
||||||
|
//次要负责人
|
||||||
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "act_id")
|
||||||
|
private List<User> assistManagers;
|
||||||
|
|
||||||
|
|
||||||
|
//考勤安排
|
||||||
|
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "attendance")
|
||||||
|
private Attendance attendance;
|
||||||
|
|
||||||
|
//活动笔记
|
||||||
|
@Column(name = "notes")
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
//图表
|
||||||
|
@ElementCollection(targetClass = java.lang.String.class)
|
||||||
|
@Column(name = "charts")
|
||||||
|
private List<String> charts;
|
||||||
|
|
||||||
|
//附件url
|
||||||
|
@Column(name = "enclosure")
|
||||||
|
private String enclosure;
|
||||||
|
|
||||||
|
//活动
|
||||||
|
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
||||||
|
@JoinColumn(name = "activity")
|
||||||
|
private Activity activity;
|
||||||
|
}
|
@ -3,10 +3,9 @@ package com.codesdream.ase.model.permission;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能性权限容器
|
* 功能性权限容器
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.codesdream.ase.model.permission;
|
package com.codesdream.ase.model.permission;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.hibernate.annotations.ManyToAny;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -6,7 +6,7 @@ import org.springframework.data.repository.CrudRepository;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface UserRepository extends CrudRepository<User, Integer> {
|
public interface UserRepository extends CrudRepository<User, Integer> {
|
||||||
|
Loading…
Reference in New Issue
Block a user