fix: 使用领取令牌隔离日计划进度
This commit is contained in:
@@ -65,7 +65,9 @@ CREATE TABLE IF NOT EXISTS `lms_daily_plan_claim` (
|
||||
`daily_plan_id` bigint NOT NULL COMMENT '日计划ID',
|
||||
`strategy_type` tinyint NOT NULL COMMENT '作业类型:1备货,2套管',
|
||||
`claimed_qty` int NOT NULL COMMENT '本次预占数量',
|
||||
`plan_version` int NOT NULL COMMENT '领取时日计划版本号',
|
||||
`plan_version` int NOT NULL COMMENT '领取时日计划版本号(仅审计,不作为确认并发边界)',
|
||||
`progress_qty` int NOT NULL COMMENT '领取时对应作业已完成数量',
|
||||
`version` int NOT NULL DEFAULT 0 COMMENT '领取乐观锁版本号',
|
||||
`claim_status` tinyint NOT NULL DEFAULT 0 COMMENT '领取状态:0执行中,1已确认,2已释放,3已过期',
|
||||
`active_flag` tinyint DEFAULT 1 COMMENT '有效领取唯一标记,终态置空',
|
||||
`expire_time` datetime NOT NULL COMMENT '租约过期时间',
|
||||
@@ -108,6 +110,22 @@ SET @lms_daily_plan_ddl = IF(
|
||||
PREPARE lms_daily_plan_stmt FROM @lms_daily_plan_ddl;
|
||||
EXECUTE lms_daily_plan_stmt;
|
||||
DEALLOCATE PREPARE lms_daily_plan_stmt;
|
||||
SET @lms_daily_plan_ddl = IF(
|
||||
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE()
|
||||
AND table_name = 'lms_daily_plan_claim' AND column_name = 'progress_qty'),
|
||||
'SELECT 1',
|
||||
'ALTER TABLE lms_daily_plan_claim ADD COLUMN progress_qty INT NOT NULL DEFAULT 0 COMMENT ''领取时对应作业已完成数量'' AFTER plan_version');
|
||||
PREPARE lms_daily_plan_stmt FROM @lms_daily_plan_ddl;
|
||||
EXECUTE lms_daily_plan_stmt;
|
||||
DEALLOCATE PREPARE lms_daily_plan_stmt;
|
||||
SET @lms_daily_plan_ddl = IF(
|
||||
EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE()
|
||||
AND table_name = 'lms_daily_plan_claim' AND column_name = 'version'),
|
||||
'SELECT 1',
|
||||
'ALTER TABLE lms_daily_plan_claim ADD COLUMN version INT NOT NULL DEFAULT 0 COMMENT ''领取乐观锁版本号'' AFTER progress_qty');
|
||||
PREPARE lms_daily_plan_stmt FROM @lms_daily_plan_ddl;
|
||||
EXECUTE lms_daily_plan_stmt;
|
||||
DEALLOCATE PREPARE lms_daily_plan_stmt;
|
||||
SET @lms_daily_plan_ddl = IF(
|
||||
EXISTS (SELECT 1 FROM information_schema.statistics WHERE table_schema = DATABASE()
|
||||
AND table_name = 'lms_daily_plan' AND index_name = 'idx_sleeving_candidate'),
|
||||
|
||||
Reference in New Issue
Block a user