wlzboy
4 天以前 cfe0b79fbea0fb1d7a5a796e71ada7d3b7812046
1
2
3
4
5
6
7
8
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
-- ===================================================================
-- 更新任务状态字典表
-- 
-- 说明:添加转运任务的完整状态流程
-- PENDING -> DEPARTING -> ARRIVED -> RETURNING -> COMPLETED/CANCELLED
-- ===================================================================
 
-- 1. 先删除旧的任务状态字典数据
DELETE FROM sys_dict_data WHERE dict_type = 'sys_task_status';
 
-- 2. 重新插入完整的任务状态字典数据
-- ----------------------------
-- 任务状态字典数据(按状态流程排序)
-- ----------------------------
 
-- 待处理(初始状态)
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(1, '待处理', 'PENDING', 'sys_task_status', '', 'warning', 'N', '0', 'admin', SYSDATE(), '', NULL, '任务已创建,等待出发');
 
-- 出发中
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(2, '出发中', 'DEPARTING', 'sys_task_status', '', 'primary', 'N', '0', 'admin', SYSDATE(), '', NULL, '任务已出发,前往目的地');
 
-- 已到达
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(3, '已到达', 'ARRIVED', 'sys_task_status', '', 'primary', 'N', '0', 'admin', SYSDATE(), '', NULL, '已到达目的地');
 
-- 返程中
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(4, '返程中', 'RETURNING', 'sys_task_status', '', 'primary', 'N', '0', 'admin', SYSDATE(), '', NULL, '任务返程中');
 
-- 已完成(结束状态)
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(5, '已完成', 'COMPLETED', 'sys_task_status', '', 'success', 'N', '0', 'admin', SYSDATE(), '', NULL, '任务已完成');
 
-- 已取消(结束状态)
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(6, '已取消', 'CANCELLED', 'sys_task_status', '', 'danger', 'N', '0', 'admin', SYSDATE(), '', NULL, '任务已取消');
 
-- 任务中(兼容旧数据)
INSERT INTO sys_dict_data(dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark)
VALUES(7, '任务中', 'IN_PROGRESS', 'sys_task_status', '', 'primary', 'N', '0', 'admin', SYSDATE(), '', NULL, '任务执行中(兼容旧数据)');
 
-- ===================================================================
-- 验证查询
-- ===================================================================
 
-- 查看更新后的任务状态字典数据
SELECT 
    dict_sort AS '排序',
    dict_label AS '状态名称',
    dict_value AS '状态值',
    list_class AS '样式',
    remark AS '说明'
FROM sys_dict_data 
WHERE dict_type = 'sys_task_status' 
ORDER BY dict_sort;
 
-- ===================================================================
-- 任务状态流程说明
-- ===================================================================
-- 
-- 正常流程:
-- PENDING(待处理)-> DEPARTING(出发中)-> ARRIVED(已到达)-> RETURNING(返程中)-> COMPLETED(已完成)
-- 
-- 取消流程:
-- 任何状态(COMPLETED除外)-> CANCELLED(已取消)
-- 
-- 兼容旧数据:
-- IN_PROGRESS(任务中)可以转换为 COMPLETED、CANCELLED 或 PENDING
-- 
-- ===================================================================