活动子系统三次完善

This commit is contained in:
chuyan 2020-02-14 16:41:47 +08:00 committed by yourtree
parent cb15f6608c
commit 60356b46fa
8 changed files with 193 additions and 15 deletions

View File

@ -111,7 +111,7 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
</dependency>
</dependency>s
</dependencies>

View File

@ -3,9 +3,7 @@ package com.codesdream.ase.component;
import com.codesdream.ase.model.permission.Tag;
import com.codesdream.ase.model.permission.User;
import org.springframework.stereotype.Component;
import sun.nio.cs.US_ASCII;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;

View File

@ -33,7 +33,7 @@ public class Activity {
@Column(nullable = false)
private String creator;
//活动类型1qa
//活动类型
@Column(nullable = false)
private String type;
@ -41,6 +41,10 @@ public class Activity {
@Column(nullable = true)
private String description;
//活动周期格式阿拉伯数字数字+单位0表示无周期
@Column(nullable = true)
private String cycle;
//自愿参与人列表
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "act_volunteer")
@ -94,7 +98,7 @@ public class Activity {
)
private Set<User> signedGroup;
//可见人员人员列表
//可见人员列表
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "act_vis",
joinColumns = {
@ -132,12 +136,10 @@ public class Activity {
//计划开始时间
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "plan_period")
private Period planPeriod;
//实际开始时间
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "real_period")
private Period realPeriod;
//提前提醒时间
@ -150,7 +152,7 @@ public class Activity {
//主要负责人
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "chief_manager", nullable = false)
@JoinColumn(nullable = false)
private User chiefManager;
//次要负责人
@ -168,7 +170,9 @@ public class Activity {
//考勤安排
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "attendance")
private Attendance attendance;
//活动报告
@OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private Report report;
}

View File

@ -24,8 +24,7 @@ public class Attendance {
private boolean isOnline;
//打卡时段列表
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "attendance")
@JoinColumn(name = "a_id")
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Period> clockInPeriods;
//打卡方式0表示被扫1表示扫

View 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;
}

View File

@ -3,10 +3,9 @@ package com.codesdream.ase.model.permission;
import lombok.Data;
import javax.persistence.*;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/**
* 功能性权限容器

View File

@ -1,7 +1,7 @@
package com.codesdream.ase.model.permission;
import lombok.Data;
import org.hibernate.annotations.ManyToAny;
import javax.persistence.*;
import java.util.HashSet;

View File

@ -6,7 +6,7 @@ import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
import java.util.Set;
@Repository
public interface UserRepository extends CrudRepository<User, Integer> {