Files
fad_oa/sql/hrm_drop_biz_status_2026_07.sql

33 lines
1.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ============================================================
-- 移除 HRM 5 张业务表的 status 冗余字段
-- - hrm_leave_req
-- - hrm_travel_req
-- - hrm_seal_req
-- - hrm_reimburse_req
-- - hrm_appropriation_req
--
-- 原因:业务表 status (pending/approved/rejected/draft) 与流程实例表
-- hrm_flow_instance.status (running/approved/rejected/withdrawn 等) 长期
-- 存在双写不同步问题——同一条申请可能出现「web 已通过 / app 审批中」
-- 的错位。改造后:状态唯一来源为 hrm_flow_instance.status
-- 「草稿态」直接砍掉(提交即入流程)。
--
-- ⚠️ 执行前请确认:
-- 1. 已完成后端代码升级HrmFlowTaskServiceImpl 不再调
-- BizStatusSyncHelper / sealReqService.updateStatus
-- 2. 5 个 domain/vo/bo 已去除 status 字段
-- 3. 5 个 Mapper XML 已去除 status 引用;统计查询已改为
-- EXISTS hrm_flow_instance
-- 4. 前端 leaveDetail / travelDetail / appropriationDetail 已
-- 改为读 flowInstance.status
-- 5. 生产库已备份
--
-- 建议执行时段:业务低峰期
-- ============================================================
ALTER TABLE hrm_leave_req DROP COLUMN status;
ALTER TABLE hrm_travel_req DROP COLUMN status;
ALTER TABLE hrm_seal_req DROP COLUMN status;
ALTER TABLE hrm_reimburse_req DROP COLUMN status;
ALTER TABLE hrm_appropriation_req DROP COLUMN status;