diff --git a/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql b/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql index 565e465..3260695 100644 --- a/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql +++ b/hzims-service/hzims-middle/src/main/resources/db/1.0.0.sql @@ -140,52 +140,4 @@ INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (10, 10, 'OFFLINEWORKTICKET', 'OFFLINEWORKTICKET', '线下工作票', '线下工作票', 'Y', 0, NULL, '2023-12-28 16:35:10', '2023-12-28 16:35:14', '线下工作票流程'); INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (11, 11, 'DEALALARM', 'DEALALARM', '告警处理流程', '告警处理流程', 'Y', 0, NULL, '2024-02-19 16:56:10', '2024-02-19 16:56:34', '告警处理流程'); INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (12, 12, 'HIDDENDANGERCHECK', 'HIDDENDANGERCHECK', '隐患排查', '隐患排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-07-25 18:35:01', '隐患排查流程'); -INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (13, 13, 'HAZARD_RISK', 'HAZARD_RISK', '风险排查', '风险排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-09-19 22:35:40', '风险排查流程'); - -alter table hzims_workflow_operation_log add is_operation_log tinyint(1) comment '1 正常日志 0 错误日志'; -alter table hzims_statistics add sort int comment '排序'; - -create table IF NOT EXISTS log_options_module_name -( - id bigint primary key auto_increment, - module_name varchar(50) null comment '功能模块', - sort int comment '排序', - create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', - update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间', - is_deleted tinyint default 0 null comment '逻辑删除 (0 可用 1 删除)' -); - -insert into log_options_module_name(module_name, sort) -values ('集中监控', 1), - ('综合调度', 2), - ('视频集中监控', 3), - ('实时监控', 4), - ('视频监控', 5), - ('演示大屏', 6), - ('生态监控', 7), - ('数据分析', 9), - ('数据查询', 10), - ('通讯告警统计', 11), - ('气象监测', 12), - ('我的事务', 13), - ('值班管理', 14), - ('缺陷管理', 15), - ('两票管理', 16), - ('巡检管理', 17), - ('日常维护', 18), - ('检修管理', 19), - ('数据填报', 20), - ('安全管理', 21), - ('设备管理', 22), - ('资产管理', 23), - ('智能诊断', 24), - ('生产月报', 25), - ('告警配置', 26), - ('电站安全标准', 27), - ('站点管理', 28), - ('实时画面', 29), - ('资源配置', 30), - ('消息管理', 31), - ('移动端配置', 32), - ('水电站设置', 33), - ('告警配置', 34); \ No newline at end of file +INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (13, 13, 'HAZARD_RISK', 'HAZARD_RISK', '风险排查', '风险排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-09-19 22:35:40', '风险排查流程'); \ No newline at end of file diff --git a/hzims-service/hzims-middle/src/main/resources/db/2.0.0.sql b/hzims-service/hzims-middle/src/main/resources/db/2.0.0.sql index 3510c9b..a008eb2 100644 --- a/hzims-service/hzims-middle/src/main/resources/db/2.0.0.sql +++ b/hzims-service/hzims-middle/src/main/resources/db/2.0.0.sql @@ -1,5 +1,12 @@ -INSERT INTO `process_dict` (`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) VALUES (10, 10, 'offlineWorkTicket', 'offlineWorkTicket', '线下工作票', '线下工作票', 'Y', 0, NULL, '2023-12-28 16:35:10', '2023-12-28 16:35:14', '线下工作票流程'); -INSERT INTO `PROCESS_DICT`(`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (11, 11, 'HAZARD_RISK', 'HAZARD_RISK', '风险排查', '风险排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-09-19 22:35:40', '风险排查流程'); -INSERT INTO `PROCESS_DICT`(`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (12, 12, 'DEALALARM', 'DEALALARM', '告警处理流程', '告警处理流程', 'Y', 0, NULL, '2024-02-19 16:56:10', '2024-02-19 16:56:34', '告警处理流程'); -INSERT INTO `PROCESS_DICT`(`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (13, 13, 'HIDDENDANGERCHECK', 'HIDDENDANGERCHECK', '隐患排查', '隐患排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-07-25 18:35:01', '隐患排查流程'); +-- 线下工作票流程 +INSERT INTO `process_dict` (`dict_code`, `dict_sort`, `dict_key`, `dict_value`, `dict_label`, `dict_type`, `is_default`, `status`, `create_dept`, `create_time`, `update_time`, `remark`) VALUES (13, 13, 'offlineWorkTicket', 'offlineWorkTicket', '线下工作票', '线下工作票', 'Y', 0, NULL, '2023-12-28 16:35:10', '2023-12-28 16:35:14', '线下工作票流程'); +-- 工作任务单流程 INSERT INTO `PROCESS_DICT` (`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (14, 14, 'WORK_TASK', 'WORK_TASK', '工作任务单V4', '工作任务单', 'Y', 0, NULL, '2023-07-25 18:35:01', '2024-01-09 14:48:18', '工作任务单流程'); +-- 风险排查流程 +INSERT INTO `PROCESS_DICT`(`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (10, 10, 'HAZARD_RISK', 'HAZARD_RISK', '风险排查', '风险排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-09-19 22:35:40', '风险排查流程'); +-- 告警处理流程 +INSERT INTO `PROCESS_DICT`(`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (11, 11, 'DEALALARM', 'DEALALARM', '告警处理流程', '告警处理流程', 'Y', 0, NULL, '2024-02-19 16:56:10', '2024-02-19 16:56:34', '告警处理流程'); +-- 隐患排查流程 +INSERT INTO `PROCESS_DICT`(`DICT_CODE`, `DICT_SORT`, `DICT_KEY`, `DICT_VALUE`, `DICT_LABEL`, `DICT_TYPE`, `IS_DEFAULT`, `STATUS`, `CREATE_DEPT`, `CREATE_TIME`, `UPDATE_TIME`, `REMARK`) VALUES (12, 12, 'HIDDENDANGERCHECK', 'HIDDENDANGERCHECK', '隐患排查', '隐患排查', 'Y', 0, NULL, '2023-07-25 18:35:01', '2023-07-25 18:35:01', '隐患排查流程'); +-- 日志记录表添加错误日志字段 +alter table `hzims_workflow_operation_log` add column `fault_log` varchar(255) default null comment '错误日志'; \ No newline at end of file diff --git a/hzims-service/inspect/src/main/resources/db/1.0.1.sql b/hzims-service/inspect/src/main/resources/db/2.0.0.sql similarity index 91% rename from hzims-service/inspect/src/main/resources/db/1.0.1.sql rename to hzims-service/inspect/src/main/resources/db/2.0.0.sql index 8507e7a..1736e4f 100644 --- a/hzims-service/inspect/src/main/resources/db/1.0.1.sql +++ b/hzims-service/inspect/src/main/resources/db/2.0.0.sql @@ -226,3 +226,17 @@ CREATE TABLE `hz_st_ex_event_record_template` ( KEY `idx_is_deleted_tenant_id` (`IS_DELETED`,`TENANT_ID`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='巡检情况记录模板表(专供演示数据使用)'; +ALTER TABLE `hz_st_ex_task_user` MODIFY COLUMN `CLAIM_STATUS` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '领用状态 0:未领用 1:已领用 每条任务可以存在多个用户,但是只有一个领用人' AFTER `USER_ID`; + +ALTER TABLE `hz_st_ex_task_user` ADD COLUMN `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `TENANT_ID`; + +alter table `hz_st_ex_task` add column `hik_video_task_id` varchar(50) default null comment '海康录制视频任务ID'; +alter table `hz_st_ex_task` add column `video_start_time` datetime default null comment '视频录制开始时间'; +alter table `hz_st_ex_task` add column `video_end_time` datetime default null comment '视频录制开始时间'; +alter table `hz_st_ex_task` add column `video_url` varchar(255) default null comment '手动录制视频地址'; +-- 巡检摄像头管理添加设备编号 +alter table `hz_st_camera_info` add column `em_code` varchar(50) default null comment '设备编号'; +alter table `hz_st_robot` add column `code` varchar(50) default null comment '机器人编号'; +alter table `hz_st_robot` add column `station_code` varchar(50) default null comment '站点编号'; +alter table `hz_st_robot` add column `is_device_instance` tinyint(2) default 0 comment '是否绑定设备实例'; +alter table `hz_st_re_object` change COLUMN `EM_CODE` `EM_CODE` VARCHAR(50) COMMENT '设备编号'; \ No newline at end of file diff --git a/hzims-service/inspect/src/main/resources/db/2.0.0.sql.1 b/hzims-service/inspect/src/main/resources/db/2.0.0.sql.1 deleted file mode 100644 index 5fef62f..0000000 --- a/hzims-service/inspect/src/main/resources/db/2.0.0.sql.1 +++ /dev/null @@ -1,14 +0,0 @@ -ALTER TABLE `hz_st_ex_task_user` MODIFY COLUMN `CLAIM_STATUS` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '领用状态 0:未领用 1:已领用 每条任务可以存在多个用户,但是只有一个领用人' AFTER `USER_ID`; - -ALTER TABLE `hz_st_ex_task_user` ADD COLUMN `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `TENANT_ID`; - -alter table `hz_st_ex_task` add column `hik_video_task_id` varchar(50) default null comment '海康录制视频任务ID'; -alter table `hz_st_ex_task` add column `video_start_time` datetime default null comment '视频录制开始时间'; -alter table `hz_st_ex_task` add column `video_end_time` datetime default null comment '视频录制开始时间'; -alter table `hz_st_ex_task` add column `video_url` varchar(255) default null comment '手动录制视频地址'; --- 巡检摄像头管理添加设备编号 -alter table `hz_st_camera_info` add column `em_code` varchar(50) default null comment '设备编号'; -alter table `hz_st_robot` add column `code` varchar(50) default null comment '机器人编号'; -alter table `hz_st_robot` add column `station_code` varchar(50) default null comment '站点编号'; -alter table `hz_st_robot` add column `is_device_instance` tinyint(2) default 0 comment '是否绑定设备实例'; -alter table `hz_st_re_object` change COLUMN `EM_CODE` `EM_CODE` VARCHAR(50) COMMENT '设备编号'; \ No newline at end of file diff --git a/hzims-service/operational/src/main/resources/db/2.0.1.sql b/hzims-service/operational/src/main/resources/db/2.0.1.sql new file mode 100644 index 0000000..141d5a7 --- /dev/null +++ b/hzims-service/operational/src/main/resources/db/2.0.1.sql @@ -0,0 +1,120 @@ +alter table hzims_oper_maintenance_plan add column station_code varchar(60) comment '站点编码'; +alter table `hzims_oper_maintenance_task` add column `is_delay` tinyint(2) DEFAULT 0 COMMENT '是否逾期'; +-- 补充执行人、创建人、更新人名称 +alter table `hzims_oper_maintenance_task` add column `disposer_name` varchar(255) comment '执行人姓名'; +alter table `hzims_oper_maintenance_task` add column `create_user_name` varchar(255) comment '创建人姓名'; +alter table `hzims_oper_maintenance_task` add column `update_user_name` varchar(255) comment '更新人姓名'; +alter table `hzims_oper_maintenance_plan` add column `disposer_name` varchar(255) comment '执行人姓名'; +alter table `hzims_oper_maintenance_plan` add column `create_user_name` varchar(255) comment '创建人姓名'; +alter table `hzims_oper_maintenance_plan` add column `update_user_name` varchar(255) comment '更新人姓名'; +-- 日常维护任务添加工作票名称 +alter table `hzims_oper_maintenance_task` add COLUMN `ticket_name` VARCHAR(255) comment '票据名称'; + +CREATE TABLE `hzims_operation`.`hz_ims_duty_log` ( + `id` bigint(20) NOT NULL, + `duty_id` bigint(20) NULL DEFAULT NULL, + `time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `duty_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `class_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `operation_finish` tinyint(6) NULL DEFAULT NULL, + `operation_un_finish` tinyint(6) NULL DEFAULT NULL, + `operation_cancel` tinyint(6) NULL DEFAULT NULL, + `work_doing` tinyint(6) NULL DEFAULT NULL, + `work_un_finish` tinyint(6) NULL DEFAULT NULL, + `work_finish` tinyint(6) NULL DEFAULT NULL, + `work_cancel` tinyint(6) NULL DEFAULT NULL, + `hand_master` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `hand_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `hand_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `carry_master` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `carry_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `carry_time` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `duty_pic` varchar(1800) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `duty_status` varchar(1800) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `notice` varchar(1800) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `STATUS` tinyint(4) NULL DEFAULT NULL COMMENT '状态(1 未提交,2流程审核中,3已完成。)', + `CREATE_TIME` datetime(0) NOT NULL COMMENT '创建时间', + `UPDATE_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + `CREATE_USER` bigint(20) NOT NULL COMMENT '创建人', + `UPDATE_USER` bigint(20) NULL DEFAULT NULL COMMENT '更新人', + `IS_DELETED` tinyint(4) NOT NULL DEFAULT 0 COMMENT '是否删除', + `CREATE_DEPT` bigint(20) NULL DEFAULT NULL, + `TENANT_ID` varchar(12) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '租户ID', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; + + +ALTER TABLE `hzims_oper_appearance` ADD COLUMN `FINDER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '问题发现人' AFTER `EXIST_DEFECT_ID`; + +ALTER TABLE `hzims_oper_appearance` ADD COLUMN `DISCRIMINATOR_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '甄别人' AFTER `FINDER_NAME`; + +ALTER TABLE `hzims_oper_appearance` ADD COLUMN `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人名称' AFTER `DISCRIMINATOR_NAME`; + +ALTER TABLE `hzims_oper_appearance` ADD COLUMN `DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构名称' AFTER `CREATE_USER_NAME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `HANDLER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检修任务处理人' AFTER `CONCLUSION_TIME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `FINDER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发现人' AFTER `HANDLER_NAME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `CONCLUSION_PEOPLE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '定论人' AFTER `FINDER_NAME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人名称' AFTER `CONCLUSION_PEOPLE_NAME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构名称' AFTER `CREATE_USER_NAME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `PRINCIPAL_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作票负责人' AFTER `DEPT_NAME`; + +ALTER TABLE `hzims_oper_defect` ADD COLUMN `PLAN_HANDLER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消缺处理人' AFTER `PRINCIPAL_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `DISCRIMINATOR_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '甄别人' AFTER `TICKET_ID`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `FINDER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发现人' AFTER `DISCRIMINATOR_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `HANDLER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检修任务处理人' AFTER `FINDER_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `DISPOSER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '处理人' AFTER `HANDLER_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `CONCLUSION_PEOPLE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '定论人' AFTER `DISPOSER_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人名称' AFTER `CONCLUSION_PEOPLE_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构名称' AFTER `CREATE_USER_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `PRINCIPAL_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作票负责人' AFTER `DEPT_NAME`; + +ALTER TABLE `hzims_oper_defect_statistics` ADD COLUMN `PLAN_HANDLER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消缺处理人' AFTER `PRINCIPAL_NAME`; + +ALTER TABLE `hzims_oper_maintenance_plan` ADD COLUMN `disposer_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行人姓名' AFTER `station_code`; + +ALTER TABLE `hzims_oper_maintenance_plan` ADD COLUMN `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `disposer_name`; + +ALTER TABLE `hzims_oper_maintenance_plan` ADD COLUMN `UPDATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `CREATE_USER_NAME`; + +ALTER TABLE `hzims_oper_maintenance_task` ADD COLUMN `is_delay` tinyint(2) NULL DEFAULT 0 COMMENT '是否逾期' AFTER `flow_description`; + +ALTER TABLE `hzims_oper_maintenance_task` ADD COLUMN `disposer_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行人姓名' AFTER `is_delay`; + +ALTER TABLE `hzims_oper_maintenance_task` ADD COLUMN `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `disposer_name`; + +ALTER TABLE `hzims_oper_maintenance_task` ADD COLUMN `UPDATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL AFTER `CREATE_USER_NAME`; + +ALTER TABLE `hzims_oper_maintenance_task` ADD COLUMN `ticket_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '票据名称' AFTER `UPDATE_USER_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `FINDER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '问题发现人' AFTER `TICKET_ID`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `DISCRIMINATOR_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '甄别人' AFTER `FINDER_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `HANDLE_PROGRAMME_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '决策处理方案人' AFTER `DISCRIMINATOR_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `HANDLER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '检修任务处理人' AFTER `HANDLE_PROGRAMME_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `CONCLUSION_PEOPLE_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '定论人' AFTER `HANDLER_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `CREATE_USER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人名称' AFTER `CONCLUSION_PEOPLE_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `DEPT_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '机构名称' AFTER `CREATE_USER_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `PRINCIPAL_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '操作票负责人' AFTER `DEPT_NAME`; + +ALTER TABLE `hzims_oper_phenomenon` ADD COLUMN `PLAN_HANDLER_NAME` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '消缺处理人' AFTER `PRINCIPAL_NAME`; + diff --git a/hzims-service/ticket/src/main/resources/db/2.0.0.sql b/hzims-service/ticket/src/main/resources/db/2.0.0.sql index ed7ad42..ff65510 100644 --- a/hzims-service/ticket/src/main/resources/db/2.0.0.sql +++ b/hzims-service/ticket/src/main/resources/db/2.0.0.sql @@ -1,173 +1 @@ -SET FOREIGN_KEY_CHECKS=0; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '站点标识-两票编码' AFTER `ticket_type`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `signage_code` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '编号(原站点ID)' AFTER `signage`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_user_id` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `signage_code`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_id` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务Id' AFTER `flow_user_id`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_task_name` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前任务名称' AFTER `flow_task_id`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `flow_task_name`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_status` int(11) NULL DEFAULT NULL COMMENT '流程状态' AFTER `next_step_operator`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_description`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_info` ADD COLUMN `class_group_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '班组' AFTER `project_name`; - -ALTER TABLE `hzims-ticket`.`hzims_standard_ticket_measure` ADD COLUMN `operation_time` datetime(0) NULL DEFAULT NULL COMMENT '操作时间' AFTER `matter_group`; - -CREATE TABLE `hzims-ticket`.`hzims_ticket_info_danger` ( - `id` bigint(20) NULL DEFAULT NULL COMMENT '编号', - `ticket_id` bigint(20) NULL DEFAULT NULL, - `dangerous_point` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '危险点', - `maintenance` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '安全措施', - `create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', - `is_deleted` tinyint(4) NULL DEFAULT 0 COMMENT '逻辑删除' -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; - -CREATE TABLE `hzims-ticket`.`hzims_work_ticket_finish` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '编号', - `ticket_id` bigint(20) NULL DEFAULT NULL COMMENT '工作票编号', - `temp_ground_num` int(11) NULL DEFAULT NULL COMMENT '临时接地线', - `temp_dismantle_num` int(11) NULL DEFAULT NULL COMMENT '临时拆除几组', - `ground_num` int(11) NULL DEFAULT NULL COMMENT '接地线几组', - `dismantle_num` int(11) NULL DEFAULT NULL COMMENT '拆除几组', - `retain_num` int(11) NULL DEFAULT NULL COMMENT '保留几组', - `create_time` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', - `update_time` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', - `principal` bigint(20) NULL DEFAULT NULL COMMENT '负责人名称', - `licensor` bigint(20) NULL DEFAULT NULL COMMENT '许可人', - `licensor_end_time` datetime(0) NULL DEFAULT NULL COMMENT '工作票终结时间', - `principal_end_time` datetime(0) NULL DEFAULT NULL COMMENT '负责人工作结束时间', - `content` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注', - `tell_content` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交底内容', - `work_end_time` datetime(0) NULL DEFAULT NULL COMMENT '结束时间', - `brake_number` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '刀闸编号', - `guardian` bigint(20) NULL DEFAULT NULL COMMENT '监护人', - `guardian_place` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '监护人地址', - `other_items` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '其他事项', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '工作结束' ROW_FORMAT = Dynamic; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `power` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT ' 工作条件( 停电或不停电)' AFTER `watch_principal_end_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `flow_user_id` varchar(5000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '用户Id' AFTER `step_operator`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `project_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '项目名称' AFTER `flow_task_name`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工作接收人' AFTER `project_name`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `job_receiver_time` datetime(0) NULL DEFAULT NULL COMMENT '工作接收人时间' AFTER `job_receiver`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_safety` tinyint(1) NULL DEFAULT 0 COMMENT '安全隔离措施附页 (true,展示附件,false,不展示附件)' AFTER `job_receiver_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_hazard` tinyint(1) NULL DEFAULT 0 COMMENT '危险点分析与预控措施票 (true,展示附件,false,不展示附件)' AFTER `is_safety`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_railway` tinyint(1) NULL DEFAULT 0 COMMENT '动火工作票 (true,展示附件,false,不展示附件)' AFTER `is_hazard`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_limited` tinyint(1) NULL DEFAULT 0 COMMENT ' 有限空间监测记录单(true,展示附件,false,不展示附件)' AFTER `is_railway`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` ADD COLUMN `is_start` tinyint(1) NULL DEFAULT 0 COMMENT '每日开工和收工时间附页' AFTER `is_limited`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `flow_description` varchar(6000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流程描述' AFTER `flow_status`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `follower_num` int(11) NULL DEFAULT 1 COMMENT '附页第几张' AFTER `flow_description`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `next_step_operator` varchar(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下一个审批人' AFTER `input`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` MODIFY COLUMN `step_operator` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前审批人' AFTER `next_step_operator`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `is_power`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `start_date_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `end_date_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `content`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `work_ticket_end_time`; - -ALTER TABLE `hzims-ticket`.`hzims_work_ticket_info` DROP COLUMN `tell_content`; - -SET FOREIGN_KEY_CHECKS=1; - - --- auto-generated definition --- auto-generated definition -create table hzims_ticket_count -( - id bigint auto_increment comment '主键ID' - primary key, - date_time varchar(20) null comment '日期', - dept_id bigint null comment '站点Id', - dept_name varchar(100) null comment '站点名称', - ticket_type varchar(255) null comment '票据类型', - ticket_number int null comment '开票数量', - ticket_complete_num int null comment '完成数量', - ticket_delay_num int null comment '延期数量', - ticket_proportion_num int null comment '合格数量', - create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', - update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间', - is_deleted tinyint(1) default 0 null comment '逻辑删除', - tenant_id varchar(12) null comment '租户ID', - create_dept varchar(30) null comment '创建部门', - status tinyint null, - create_user bigint not null comment '创建人', - update_user bigint null, - invalidated_ticket_num int null comment '废票数量', - wrong_ticket_num int null comment '错票数量', - percent_pass_ticket varchar(50) null comment '合格率' -) - comment '两票统计分析' row_format = DYNAMIC; - - - -insert into hzims_work_ticket_finish(ticket_id, ground_num, brake_number) -select ticket_id, ground_switch_count,ground_wire_code -from hzims_work_ticket_flow; - - -alter table hzims_ticket_count add invalidated_ticket_num int null comment '废票数量'; - -# 工作票更新 -update hzims_work_ticket_info set flow_task_name = '签发' where status = 1; -update hzims_work_ticket_info set flow_task_name = '收到工作票' where status = 2; -update hzims_work_ticket_info set flow_task_name = '许可人许可' where status = 3; -update hzims_work_ticket_info set flow_task_name = '确认条件具备' where status = 4; -update hzims_work_ticket_info set flow_task_name = '工作负责人确认工作' where status = 5; -update hzims_work_ticket_info set flow_task_name = '许可人确认工作结束' where status = 6; -update hzims_work_ticket_info set flow_task_name = '工作票终结' where status = 7; -update hzims_work_ticket_info set flow_task_name = '许可人延期确认' where status = 9; -update hzims_work_ticket_info set flow_task_name = '负责人延期确认' where status = 10; -update hzims_work_ticket_info set flow_task_name = '作废' where status = 11; -update hzims_work_ticket_info set flow_task_name = '逾期' where status = 12; -# 操作票更新 -update hzims_standard_ticket_info set flow_task_name = '待监护人确认' where status = 1; -update hzims_standard_ticket_info set flow_task_name = '待值班负责人确认' where status = 2; -update hzims_standard_ticket_info set flow_task_name = '结束' where status = 3; -update hzims_standard_ticket_info set flow_task_name = '终止' where status = 4; - - -alter table hzims_ticket_count add wrong_ticket_num int null comment '错票数量'; -alter table hzims_ticket_count add percent_pass_ticket varchar(50) null comment '合格率'; - --- 两票开票视图 -create or replace view v_hzims_ticket_info as -select hzims_ticket_info.* from -(select `id`, `process_instance_id`, `type`, `company`, `code`, `task_type`, `task_id`, `task_name`, `plan_start_time`, - `plan_end_time`, `status`,`tenant_id`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, - `create_dept`,`flow_description` - from hzims_work_ticket_info - union all - select `id`, `process_instance_id`, `ticket_type` type, `company`, `code`, `task_type`, `task_id`, `task_name`, - `start_time` plan_start_time, `end_time` plan_end_time, `status`,`tenant_id`, `create_user`, `create_time`, - `update_user`, `update_time`, `is_deleted`, `create_dept`,`flow_description` - from hzims_standard_ticket_info -) hzims_ticket_info where hzims_ticket_info.IS_DELETED = 0; +alter table `hzims_work_ticket_info` add column `is_offline` tinyint(2) default 0 comment '是否线下 : 1-线下,0-线上'; \ No newline at end of file