xiatian 2 lat temu
rodzic
commit
4764874821

+ 109 - 6
db/init.sql

@@ -1,4 +1,3 @@
-
 -- ----------------------------
 -- Table structure for mps_course
 -- ----------------------------
@@ -57,6 +56,77 @@ CREATE TABLE `mps_paper` (
   UNIQUE KEY `IDX_PAPER_01` (`school_id`,`exam_id`,`course_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
+-- ----------------------------
+-- Table structure for mps_paper_detail
+-- ----------------------------
+DROP TABLE IF EXISTS `mps_paper_detail`;
+CREATE TABLE `mps_paper_detail` (
+  `id` bigint NOT NULL AUTO_INCREMENT,
+  `create_time` bigint DEFAULT NULL,
+  `update_time` bigint DEFAULT NULL,
+  `creator_id` bigint DEFAULT NULL,
+  `updater_id` bigint DEFAULT NULL,
+  `name` varchar(255) COLLATE utf8_bin NOT NULL,
+  `number` int NOT NULL,
+  `paper_id` bigint NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `IDX_PAPER_DETAIL_01` (`paper_id`,`number`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+-- ----------------------------
+-- Table structure for mps_paper_detail_unit
+-- ----------------------------
+DROP TABLE IF EXISTS `mps_paper_detail_unit`;
+CREATE TABLE `mps_paper_detail_unit` (
+  `id` bigint NOT NULL AUTO_INCREMENT,
+  `create_time` bigint DEFAULT NULL,
+  `update_time` bigint DEFAULT NULL,
+  `creator_id` bigint DEFAULT NULL,
+  `updater_id` bigint DEFAULT NULL,
+  `detail_id` bigint NOT NULL,
+  `detail_number` int NOT NULL,
+  `number` int NOT NULL,
+  `paper_id` bigint NOT NULL,
+  `score` double NOT NULL,
+  `score_step` double NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `IDX_PAPER_DETAIL_UNIT_01` (`paper_id`,`detail_id`,`number`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+-- ----------------------------
+-- Table structure for mps_paper_group
+-- ----------------------------
+DROP TABLE IF EXISTS `mps_paper_group`;
+CREATE TABLE `mps_paper_group` (
+  `id` bigint NOT NULL AUTO_INCREMENT,
+  `create_time` bigint DEFAULT NULL,
+  `update_time` bigint DEFAULT NULL,
+  `creator_id` bigint DEFAULT NULL,
+  `updater_id` bigint DEFAULT NULL,
+  `number` int NOT NULL,
+  `paper_id` bigint NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `IDX_PAPER_GROUP_01` (`paper_id`,`number`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+-- ----------------------------
+-- Table structure for mps_paper_group_unit
+-- ----------------------------
+DROP TABLE IF EXISTS `mps_paper_group_unit`;
+CREATE TABLE `mps_paper_group_unit` (
+  `id` bigint NOT NULL AUTO_INCREMENT,
+  `create_time` bigint DEFAULT NULL,
+  `update_time` bigint DEFAULT NULL,
+  `creator_id` bigint DEFAULT NULL,
+  `updater_id` bigint DEFAULT NULL,
+  `group_id` bigint NOT NULL,
+  `paper_id` bigint NOT NULL,
+  `unit_id` bigint NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `IDX_PAPER_GROUP_UNIT_01` (`paper_id`,`group_id`,`unit_id`),
+  UNIQUE KEY `IDX_PAPER_GROUP_UNIT_02` (`unit_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
 -- ----------------------------
 -- Table structure for mps_privilege
 -- ----------------------------
@@ -81,18 +151,36 @@ CREATE TABLE `mps_privilege` (
   UNIQUE KEY `IDX_PRIVILEGE_01` (`code`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
+-- ----------------------------
+-- Table structure for mps_role
+-- ----------------------------
+DROP TABLE IF EXISTS `mps_role`;
+CREATE TABLE `mps_role` (
+  `id` bigint NOT NULL AUTO_INCREMENT,
+  `create_time` bigint DEFAULT NULL,
+  `update_time` bigint DEFAULT NULL,
+  `creator_id` bigint DEFAULT NULL,
+  `updater_id` bigint DEFAULT NULL,
+  `code` varchar(255) COLLATE utf8_bin NOT NULL,
+  `name` varchar(255) COLLATE utf8_bin NOT NULL,
+  `school_id` bigint NOT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `IDX_ROLE_01` (`school_id`,`code`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
 -- ----------------------------
 -- Table structure for mps_role_privilege_relation
 -- ----------------------------
 DROP TABLE IF EXISTS `mps_role_privilege_relation`;
 CREATE TABLE `mps_role_privilege_relation` (
-  `role` varchar(255) COLLATE utf8_bin NOT NULL,
+  `schoolId` bigint NOT NULL,
+  `role_id` bigint NOT NULL,
   `privilege_id` bigint NOT NULL,
   `create_time` bigint DEFAULT NULL,
   `update_time` bigint DEFAULT NULL,
   `creator_id` bigint DEFAULT NULL,
   `updater_id` bigint DEFAULT NULL,
-  PRIMARY KEY (`role`,`privilege_id`)
+  PRIMARY KEY (`schoolId`,`role_id`,`privilege_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
 -- ----------------------------
@@ -105,13 +193,15 @@ CREATE TABLE `mps_school` (
   `update_time` bigint DEFAULT NULL,
   `creator_id` bigint DEFAULT NULL,
   `updater_id` bigint DEFAULT NULL,
+  `code` varchar(255) COLLATE utf8_bin NOT NULL,
   `contacts` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `enable` bit(1) NOT NULL,
   `name` varchar(255) COLLATE utf8_bin NOT NULL,
   `region` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   `telephone` varchar(255) COLLATE utf8_bin DEFAULT NULL,
   PRIMARY KEY (`id`),
-  UNIQUE KEY `IDX_SCHOOL_01` (`name`)
+  UNIQUE KEY `IDX_SCHOOL_01` (`name`),
+  UNIQUE KEY `IDX_SCHOOL_02` (`code`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
 -- ----------------------------
@@ -124,13 +214,26 @@ CREATE TABLE `mps_user` (
   `update_time` bigint DEFAULT NULL,
   `creator_id` bigint DEFAULT NULL,
   `updater_id` bigint DEFAULT NULL,
-  `course` text COLLATE utf8_bin,
   `enable` bit(1) NOT NULL,
   `login_name` varchar(255) COLLATE utf8_bin NOT NULL,
   `name` varchar(255) COLLATE utf8_bin NOT NULL,
   `password` varchar(255) COLLATE utf8_bin DEFAULT NULL,
-  `role` varchar(255) COLLATE utf8_bin NOT NULL,
+  `role_id` bigint NOT NULL,
   `school_id` bigint NOT NULL,
   PRIMARY KEY (`id`),
   UNIQUE KEY `IDX_USER_01` (`school_id`,`login_name`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+-- ----------------------------
+-- Table structure for mps_user_course_relation
+-- ----------------------------
+DROP TABLE IF EXISTS `mps_user_course_relation`;
+CREATE TABLE `mps_user_course_relation` (
+  `user_id` bigint NOT NULL,
+  `course_id` bigint NOT NULL,
+  `create_time` bigint DEFAULT NULL,
+  `update_time` bigint DEFAULT NULL,
+  `creator_id` bigint DEFAULT NULL,
+  `updater_id` bigint DEFAULT NULL,
+  PRIMARY KEY (`user_id`,`course_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

+ 35 - 0
src/main/java/cn/com/qmth/mps/entity/PaperDetailEntity.java

@@ -0,0 +1,35 @@
+package cn.com.qmth.mps.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import cn.com.qmth.mps.entity.base.AuditingEntity;
+
+@TableName("mps_paper_detail")
+public class PaperDetailEntity extends AuditingEntity{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -5581039038244553146L;
+	private Long paperId;
+	private String name;
+	private Integer number;
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	public Integer getNumber() {
+		return number;
+	}
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+	public Long getPaperId() {
+		return paperId;
+	}
+	public void setPaperId(Long paperId) {
+		this.paperId = paperId;
+	}
+	
+}

+ 68 - 0
src/main/java/cn/com/qmth/mps/entity/PaperDetailUnitEntity.java

@@ -0,0 +1,68 @@
+package cn.com.qmth.mps.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import cn.com.qmth.mps.entity.base.AuditingEntity;
+
+@TableName("mps_paper_detail_unit")
+public class PaperDetailUnitEntity extends AuditingEntity {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -2626652229749411040L;
+	private Long paperId;
+	private Long detailId;
+	private Integer detailNumber;
+	private Integer number;
+	private Double score;
+	private Double scoreStep;
+
+	public Integer getNumber() {
+		return number;
+	}
+
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+
+	public Double getScore() {
+		return score;
+	}
+
+	public void setScore(Double score) {
+		this.score = score;
+	}
+
+	public Double getScoreStep() {
+		return scoreStep;
+	}
+
+	public void setScoreStep(Double scoreStep) {
+		this.scoreStep = scoreStep;
+	}
+
+	public Long getPaperId() {
+		return paperId;
+	}
+
+	public void setPaperId(Long paperId) {
+		this.paperId = paperId;
+	}
+
+	public Long getDetailId() {
+		return detailId;
+	}
+
+	public void setDetailId(Long detailId) {
+		this.detailId = detailId;
+	}
+
+	public Integer getDetailNumber() {
+		return detailNumber;
+	}
+
+	public void setDetailNumber(Integer detailNumber) {
+		this.detailNumber = detailNumber;
+	}
+
+}

+ 28 - 0
src/main/java/cn/com/qmth/mps/entity/PaperGroupEntity.java

@@ -0,0 +1,28 @@
+package cn.com.qmth.mps.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import cn.com.qmth.mps.entity.base.AuditingEntity;
+
+@TableName("mps_paper_group")
+public class PaperGroupEntity extends AuditingEntity{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -8843551391313294436L;
+	private Long paperId;
+	private Integer number;
+	public Integer getNumber() {
+		return number;
+	}
+	public void setNumber(Integer number) {
+		this.number = number;
+	}
+	public Long getPaperId() {
+		return paperId;
+	}
+	public void setPaperId(Long paperId) {
+		this.paperId = paperId;
+	}
+	
+}

+ 36 - 0
src/main/java/cn/com/qmth/mps/entity/PaperGroupUnitEntity.java

@@ -0,0 +1,36 @@
+package cn.com.qmth.mps.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import cn.com.qmth.mps.entity.base.AuditingEntity;
+
+@TableName("mps_paper_group_unit")
+public class PaperGroupUnitEntity extends AuditingEntity{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 5657687276637032291L;
+	private Long paperId;
+	private Long groupId;
+	private Long unitId;
+	public Long getPaperId() {
+		return paperId;
+	}
+	public void setPaperId(Long paperId) {
+		this.paperId = paperId;
+	}
+	public Long getGroupId() {
+		return groupId;
+	}
+	public void setGroupId(Long groupId) {
+		this.groupId = groupId;
+	}
+	public Long getUnitId() {
+		return unitId;
+	}
+	public void setUnitId(Long unitId) {
+		this.unitId = unitId;
+	}
+
+	
+}

+ 55 - 0
src/main/java/cn/com/qmth/mps/entity/RoleEntity.java

@@ -0,0 +1,55 @@
+package cn.com.qmth.mps.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import cn.com.qmth.mps.entity.base.AuditingEntity;
+
+@TableName("mps_role")
+public class RoleEntity extends AuditingEntity {
+
+	private static final long serialVersionUID = -2167420238674588632L;
+
+
+	/**
+	 * 角色码(全局唯一)
+	 */
+	private String code;
+
+	/**
+	 * 角色名称
+	 */
+	private String name;
+
+	/**
+	 * 顶级机构.为null时,为全局角色
+	 */
+	private Long schoolId;
+
+
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Long getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Long schoolId) {
+		this.schoolId = schoolId;
+	}
+
+	
+
+}

+ 19 - 10
src/main/java/cn/com/qmth/mps/entity/RolePrivilegeRelationEntity.java

@@ -4,26 +4,19 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
 
 import cn.com.qmth.mps.entity.base.AuditingWithoutIdEntity;
-import cn.com.qmth.mps.enums.Role;
 @TableName("mps_role_privilege_relation")
 public class RolePrivilegeRelationEntity extends AuditingWithoutIdEntity {
 
 	private static final long serialVersionUID = 8849214483955278647L;
 
 	@MppMultiId
-	private Role role;
+	private Long schoolId;
+	@MppMultiId
+	private Long roleId;
 
 	@MppMultiId
 	private Long privilegeId;
 
-	public Role getRole() {
-		return role;
-	}
-
-	public void setRole(Role role) {
-		this.role = role;
-	}
-
 	public Long getPrivilegeId() {
 		return privilegeId;
 	}
@@ -32,4 +25,20 @@ public class RolePrivilegeRelationEntity extends AuditingWithoutIdEntity {
 		this.privilegeId = privilegeId;
 	}
 
+	public Long getSchoolId() {
+		return schoolId;
+	}
+
+	public void setSchoolId(Long schoolId) {
+		this.schoolId = schoolId;
+	}
+
+	public Long getRoleId() {
+		return roleId;
+	}
+
+	public void setRoleId(Long roleId) {
+		this.roleId = roleId;
+	}
+
 }

+ 9 - 0
src/main/java/cn/com/qmth/mps/entity/SchoolEntity.java

@@ -7,6 +7,7 @@ import cn.com.qmth.mps.entity.base.AuditingEntity;
 public class SchoolEntity extends AuditingEntity {
 
 	private static final long serialVersionUID = -592353272256492483L;
+	private String code;
 	private String name;
 	private Boolean enable;
 
@@ -57,6 +58,14 @@ public class SchoolEntity extends AuditingEntity {
 		this.region = region;
 	}
 
+	public String getCode() {
+		return code;
+	}
+
+	public void setCode(String code) {
+		this.code = code;
+	}
+
 	
 
 }

+ 36 - 0
src/main/java/cn/com/qmth/mps/entity/UserCourseRelationEntity.java

@@ -0,0 +1,36 @@
+package cn.com.qmth.mps.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
+
+import cn.com.qmth.mps.entity.base.AuditingWithoutIdEntity;
+
+@TableName("mps_user_course_relation")
+public class UserCourseRelationEntity extends AuditingWithoutIdEntity {
+
+	private static final long serialVersionUID = 8849214483955278647L;
+
+	@MppMultiId
+	private Long userId;
+
+	@MppMultiId
+	private Long courseId;
+
+	public Long getUserId() {
+		return userId;
+	}
+
+	public void setUserId(Long userId) {
+		this.userId = userId;
+	}
+
+	public Long getCourseId() {
+		return courseId;
+	}
+
+	public void setCourseId(Long courseId) {
+		this.courseId = courseId;
+	}
+
+
+}

+ 5 - 21
src/main/java/cn/com/qmth/mps/entity/UserEntity.java

@@ -1,13 +1,8 @@
 package cn.com.qmth.mps.entity;
 
-import java.util.List;
-
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
 
 import cn.com.qmth.mps.entity.base.AuditingEntity;
-import cn.com.qmth.mps.enums.Role;
 @TableName(value="mps_user",autoResultMap = true)
 public class UserEntity extends AuditingEntity {
 
@@ -18,10 +13,7 @@ public class UserEntity extends AuditingEntity {
 
 	private String password;
 	private Boolean enable;
-	
-	@TableField(value = "params", typeHandler = JacksonTypeHandler.class)
-	private List<String> course;
-	private Role role;
+	private Long roleId;
 
 	public Long getSchoolId() {
 		return schoolId;
@@ -63,22 +55,14 @@ public class UserEntity extends AuditingEntity {
 		this.enable = enable;
 	}
 
-	public Role getRole() {
-		return role;
-	}
-
-	public void setRole(Role role) {
-		this.role = role;
+	public Long getRoleId() {
+		return roleId;
 	}
 
-	public List<String> getCourse() {
-		return course;
+	public void setRoleId(Long roleId) {
+		this.roleId = roleId;
 	}
 
-	public void setCourse(List<String> course) {
-		this.course = course;
-	}
-	
 
 	
 }

+ 0 - 8
src/main/java/cn/com/qmth/mps/vo/user/UserVo.java

@@ -24,8 +24,6 @@ public class UserVo extends BaseEntity{
 	private String loginName;
 	@ApiModelProperty("启用禁用")
 	private Boolean enable;
-	@ApiModelProperty("科目代码集合")
-	private List<String> course;
 	@ApiModelProperty("科目信息集合")
 	private List<CourseEntity> courseInfo;
 	@ApiModelProperty("角色")
@@ -66,12 +64,6 @@ public class UserVo extends BaseEntity{
 	public void setEnable(Boolean enable) {
 		this.enable = enable;
 	}
-	public List<String> getCourse() {
-		return course;
-	}
-	public void setCourse(List<String> course) {
-		this.course = course;
-	}
 	public Role getRole() {
 		return role;
 	}