deason 4 年之前
父节点
当前提交
97c565d46b

+ 137 - 0
upgrade-202011/2021-04-升级说明.txt

@@ -0,0 +1,137 @@
+
+本次升级变更部分,依次按下面顺序执行!
+
+1、各工程代码合并至 master 分支(已合并)
+
+    配置项变更(已配置到配置中心工程)
+    ../prod/application.properties
+        examcloud.data.rule.enable=true
+
+    ../prod/application-API.properties
+        question.api.domain=https://www.exam-cloud.cn
+        oe.admin.api.domain=https://www.exam-cloud.cn
+
+2、在Jenkins上各工程打包,历史各工程包先备份!再将“待发布工程包”分发 至 各服务器的对应目录
+
+3、限制登录入口 --> 停服
+
+4、执行数据库升级脚本
+
+    # 新增用户日志表
+    CREATE TABLE `ec_b_admin_operate` (
+      `id` bigint(20) NOT NULL AUTO_INCREMENT,
+      `creation_time` datetime NOT NULL,
+      `update_time` datetime NOT NULL,
+      `msg_id` varchar(255) NOT NULL,
+      `operate` varchar(255) NOT NULL,
+      `operate_info` varchar(500),
+      `operate_ip` varchar(255) NOT NULL,
+      `operate_time` datetime NOT NULL,
+      `operate_user_id` bigint(20) NOT NULL,
+      `root_org_id` bigint(20) NOT NULL,
+      PRIMARY KEY (`id`),
+      UNIQUE KEY `IDX_R_ADMIN_OPERATE_03` (`msg_id`),
+      KEY `IDX_R_ADMIN_OPERATE_01` (`root_org_id`,`operate_user_id`),
+      KEY `IDX_R_ADMIN_OPERATE_02` (`root_org_id`,`operate_user_id`,`operate_time`)
+    ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
+
+    # 新增数据权限规则表
+    CREATE TABLE ec_b_user_data_rule (
+        id BIGINT ( 20 ) NOT NULL AUTO_INCREMENT,
+        root_org_id BIGINT ( 20 ) NOT NULL,
+        user_id BIGINT ( 20 ) NOT NULL,
+        type VARCHAR ( 50 ) NOT NULL,
+        ref_id BIGINT ( 20 ) NOT NULL,
+        enabled bit ( 1 ) NOT NULL DEFAULT b'1',
+        creation_time datetime ( 6 ) NOT NULL,
+        update_time datetime ( 6 ) NOT NULL,
+        PRIMARY KEY ( id ),
+    UNIQUE KEY IDX_USER_DATA_RULE_01 ( user_id, type, ref_id )
+    ) ENGINE = INNODB AUTO_INCREMENT = 0 DEFAULT CHARSET = utf8;
+
+    # 新增阅卷异步导出表
+    CREATE TABLE `ec_m_export_task` (
+      `id` bigint(20) NOT NULL AUTO_INCREMENT,
+      `creation_time` datetime NOT NULL,
+      `update_time` datetime NOT NULL,
+      `work_id` bigint(20) DEFAULT NULL,
+      `file_path` varchar(255) DEFAULT NULL,
+      `root_org_id` bigint(20) NOT NULL,
+      `status` varchar(50) NOT NULL,
+      `status_msg` varchar(500) DEFAULT NULL,
+      `type` varchar(50) NOT NULL,
+      `creator` bigint(20) NOT NULL,
+      `export_param` varchar(500) DEFAULT NULL,
+      `start_time` datetime DEFAULT NULL,
+      `end_time` datetime DEFAULT NULL,
+      PRIMARY KEY (`id`),
+      KEY `IDX_OE_ET_001` (`root_org_id`),
+      KEY `IDX_OE_ET_002` (`work_id`),
+      KEY `IDX_OE_ET_003` (`type`),
+      KEY `IDX_OE_ET_004` (`status`)
+    ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
+
+
+    # 新增“学院管理员”角色
+    INSERT INTO ec_b_role ( CODE, NAME, root_org_id, creation_time, update_time ) VALUES ( 'DATA_ADMIN', '学院管理员', NULL, now(), now());
+
+    # 网考异步导出表 新增字段
+    alter table ec_oe_export_task add export_param varchar(500);
+    alter table ec_oe_export_task add start_time datetime DEFAULT NULL;
+    alter table ec_oe_export_task add end_time datetime DEFAULT NULL;
+
+    # 首次登录改密码
+    alter table ec_b_user add password_weak bit(1) NOT NULL DEFAULT 1;
+    update ec_b_user set password_weak=0;
+
+    alter table ec_b_student add password_weak bit(1) NOT NULL DEFAULT 1;
+    update ec_b_student set password_weak=0;
+
+    #学生密码加密(可重复执行)
+    update ec_b_student set password=UPPER(SHA2(CONCAT(identity_number,password),256)) where LENGTH(password)<64;
+
+    #后台用户密码加密(可重复执行)
+    update ec_b_user set password=UPPER(SHA2(CONCAT(login_name,password),256))
+    where id not in (select f.user_id from ec_b_user_role_relation f where f.role_id=1) and LENGTH(password)<64;
+
+
+    MySQL 添加索引(大表,执行非常耗时):
+    ALTER TABLE ec_e_exam_student DROP INDEX IDX_E_E_S_001001;
+    ALTER TABLE ec_e_exam_student ADD UNIQUE INDEX IDX_E_E_S_001001 (exam_id, course_id, student_id) USING BTREE;
+
+    ALTER TABLE ec_e_exam_student ADD INDEX IDX_E_E_S_001007 (org_id);
+    ALTER TABLE ec_b_student ADD INDEX IDX_B_S_002002 (org_id);
+
+    MongoDB 添加索引(大表,执行非常耗时):
+    db.getCollection('examRecordQuestions').createIndex({examRecordDataId:1},{"name":"INDEX_examRecordDataId","background":true})
+
+
+    网考导出任务 - 参数配置:
+    INSERT INTO ec_b_sys_prop ( prop_key, prop_value, prop_value_type, description, creation_time, update_time )
+    VALUES ('oe.export.jobCount','1','INTEGER','网考导出任务并发数',now(),now());
+
+    INSERT INTO ec_b_sys_prop ( prop_key, prop_value, prop_value_type, description, creation_time, update_time )
+    VALUES ('m.export.jobCount','1','INTEGER','阅卷导出任务并发数',now(),now());
+
+
+5、数据割接工具
+
+    # 初始化用户数据权限基础数据
+    工程源码:http://git.qmth.com.cn/examcloud-DevOps/examcloud-oe-tool.git
+    master 分支下,找到 “cn.com.qmth.dp.examcloud.oe.modules.init_user_data_rule.InitUserDataRule” 工具类
+    配置好“正式环境”的数据库账号(可读写账号)后,打包至服务器环境上执行一次即可(允许重复执行)!
+
+
+6、启所有应用服务,注意oe-task工程的配置文件是否配对!!!
+
+
+7、管理端 --> 新增菜单:
+    基础信息菜单 --> 用户管理 --> 操作日志 【编码:index_admin_operate】 【属性1:menu】 【权重:0】 【属性5:/basic/admin_operate】
+    基础信息菜单 --> 用户管理 --> 普通用户管理 --> 数据权限按钮 【编码:user_data_rule_setting】 【属性1:button】 【权重:0】
+    基础信息菜单 --> 用户管理 --> 普通用户管理 --> 权限复制按钮 【编码:user_data_rule_copy】 【属性1:button】 【权重:0】
+    阅卷管理菜单 --> 任务管理 【编码:marking_task_manager】 【属性1:menu】 【权重:6】
+    阅卷管理菜单 --> 任务管理 --> 导出任务列表  【编码:marking_export_task_list】 【属性1:menu】 【权重:10】 【属性5:/marking/export_task_list】
+
+
+8、发版完成!
+

+ 0 - 4
upgrade-202011/about.txt

@@ -1,4 +0,0 @@
-
-
-todo
-

+ 0 - 15
upgrade-202011/参数配置.txt

@@ -1,15 +0,0 @@
-管理端 -> 系统管理 -> 参数配置 -> 新增:
-    oe.export.jobCount INTEGER 1 网考导出任务并发数
-    m.export.jobCount INTEGER 1 阅卷导出任务并发数
-
-    或者通过执行以下SQL新增:
-    INSERT INTO ec_b_sys_prop ( prop_key, prop_value, prop_value_type, description, creation_time, update_time )
-    VALUES ('oe.export.jobCount','1','INTEGER','网考导出任务并发数',now(),now());
-    
-    INSERT INTO ec_b_sys_prop ( prop_key, prop_value, prop_value_type, description, creation_time, update_time )
-    VALUES ('m.export.jobCount','1','INTEGER','阅卷导出任务并发数',now(),now());
-
-
-
-
-

+ 0 - 96
upgrade-202011/数据库变更.txt

@@ -1,96 +0,0 @@
-
--------------------- 模块: basic Start --------------------
-#用户日志表
-
-CREATE TABLE `ec_b_admin_operate` (
-  `id` bigint(20) NOT NULL AUTO_INCREMENT,
-  `creation_time` datetime NOT NULL,
-  `update_time` datetime NOT NULL,
-  `msg_id` varchar(255) NOT NULL,
-  `operate` varchar(255) NOT NULL,
-  `operate_info` varchar(500),
-  `operate_ip` varchar(255) NOT NULL,
-  `operate_time` datetime NOT NULL,
-  `operate_user_id` bigint(20) NOT NULL,
-  `root_org_id` bigint(20) NOT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `IDX_R_ADMIN_OPERATE_03` (`msg_id`),
-  KEY `IDX_R_ADMIN_OPERATE_01` (`root_org_id`,`operate_user_id`),
-  KEY `IDX_R_ADMIN_OPERATE_02` (`root_org_id`,`operate_user_id`,`operate_time`)
-) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
-
-#首次登录改密码
-alter table ec_b_user add password_weak bit(1) NOT NULL DEFAULT 1;
-update ec_b_user set password_weak=0;
-
-alter table ec_b_student add password_weak bit(1) NOT NULL DEFAULT 1;
-update ec_b_student set password_weak=0;
-
-#学生密码加密(可重复执行)
-update ec_b_student set password=UPPER(SHA2(CONCAT(identity_number,password),256)) where LENGTH(password)<64;
-#后台用户密码加密(可重复执行)
-update ec_b_user set password=UPPER(SHA2(CONCAT(login_name,password),256)) where id not in (select f.user_id from ec_b_user_role_relation f where f.role_id=1) and LENGTH(password)<64;
-
-
-# 数据权限规则表
-CREATE TABLE ec_b_user_data_rule (
-	id BIGINT ( 20 ) NOT NULL AUTO_INCREMENT,
-	root_org_id BIGINT ( 20 ) NOT NULL,
-	user_id BIGINT ( 20 ) NOT NULL,
-	type VARCHAR ( 50 ) NOT NULL,
-	ref_id BIGINT ( 20 ) NOT NULL,
-	enabled bit ( 1 ) NOT NULL DEFAULT b'1',
-	creation_time datetime ( 6 ) NOT NULL,
-	update_time datetime ( 6 ) NOT NULL,
-	PRIMARY KEY ( id ),
-UNIQUE KEY IDX_USER_DATA_RULE_01 ( user_id, type, ref_id )
-) ENGINE = INNODB AUTO_INCREMENT = 0 DEFAULT CHARSET = utf8;
-
-新增“学院管理员”角色
-INSERT INTO ec_b_role ( CODE, NAME, root_org_id, creation_time, update_time ) VALUES ( 'DATA_ADMIN', '学院管理员', NULL, now(), now());
--------------------- 模块: basic End --------------------
-
--------------------- 模块: oe-admin Start --------------------
-#网考异步导出
-alter table ec_oe_export_task add export_param varchar(500);
-alter table ec_oe_export_task add start_time datetime DEFAULT NULL;
-alter table ec_oe_export_task add end_time datetime DEFAULT NULL;
-
--------------------- 模块: oe-admin End --------------------
-
-
-
-MySQL添加索引:
-ALTER TABLE ec_e_exam_student DROP INDEX IDX_E_E_S_001001;
-ALTER TABLE ec_e_exam_student ADD UNIQUE INDEX IDX_E_E_S_001001 (exam_id, course_id, student_id) USING BTREE;
-ALTER TABLE ec_e_exam_student ADD INDEX IDX_E_E_S_001007 (org_id);
-ALTER TABLE ec_b_student ADD INDEX IDX_B_S_002002 (org_id);
-
-MongoDB添加索引:
-db.getCollection('examRecordQuestions').createIndex({examRecordDataId:1},{"name":"INDEX_examRecordDataId","background":true})
-
-
-#阅卷异步导出
-CREATE TABLE `ec_m_export_task` (
-  `id` bigint(20) NOT NULL AUTO_INCREMENT,
-  `creation_time` datetime NOT NULL,
-  `update_time` datetime NOT NULL,
-  `work_id` bigint(20) DEFAULT NULL,
-  `file_path` varchar(255) DEFAULT NULL,
-  `root_org_id` bigint(20) NOT NULL,
-  `status` varchar(50) NOT NULL,
-  `status_msg` varchar(500) DEFAULT NULL,
-  `type` varchar(50) NOT NULL,
-  `creator` bigint(20) NOT NULL,
-  `export_param` varchar(500) DEFAULT NULL,
-  `start_time` datetime DEFAULT NULL,
-  `end_time` datetime DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  KEY `IDX_OE_ET_001` (`root_org_id`),
-  KEY `IDX_OE_ET_002` (`work_id`),
-  KEY `IDX_OE_ET_003` (`type`),
-  KEY `IDX_OE_ET_004` (`status`)
-) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
-
-
-

+ 0 - 13
upgrade-202011/菜单变更.txt

@@ -1,13 +0,0 @@
-
-
-新增菜单:
-		基础信息菜单 --> 用户管理 --> 操作日志 【编码:index_admin_operate】 【属性1:menu】 【权重:0】 【属性5:/basic/admin_operate】
-
-		基础信息菜单 --> 用户管理 --> 普通用户管理 --> 数据权限按钮 【编码:user_data_rule_setting】 【属性1:button】 【权重:0】
-
-		基础信息菜单 --> 用户管理 --> 普通用户管理 --> 权限复制按钮 【编码:user_data_rule_copy】 【属性1:button】 【权重:0】
-		
-		阅卷管理菜单 --> 任务管理 【编码:marking_task_manager】 【属性1:menu】 【权重:6】 
-		
-		阅卷管理菜单 --> 任务管理 --> 导出任务列表  【编码:marking_export_task_list】 【属性1:menu】 【权重:10】 【属性5:/marking/export_task_list】
-

+ 0 - 16
upgrade-202011/配置变更.txt

@@ -1,16 +0,0 @@
-
-
-application.properties {
-    examcloud.data.rule.enable=true
-}
-
-
--------------------- 模块: app-api Start --------------------
-
-# application-API.properties 增加
-
-question.api.domain=xxx
-oe.admin.api.domain=xxx
-
--------------------- 模块: app-api End --------------------
-