111
rk
2025-08-21 4e3e18cdb0d75c098b68353ef8c86cdd7c0f79b2
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
73
74
package com.doumee.core.job;
 
import com.alibaba.fastjson.JSON;
 
import java.util.Date;
import java.util.HashMap;
import java.util.List;
 
/**
 * JOB入参
 * @author  dm
 * @since 2025/03/31 16:44
 */
public class JobParam extends HashMap<String, Object> {
 
    // JOB或分片ID
    private static final String KEY_ID = "id";
 
    // 业务时间
    private static final String KEY_BUSINESS_TIME = "businessTime";
 
    // 分片索引
    private static final String KEY_SNIPPET_INDEX = "snippetIndex";
 
    // 触发方式
    private static final String KEY_TRIGGER_TYPE = "triggerType";
 
    // 业务数据
    private static final String KEY_RUNTIME_DATA = "runtimeData";
 
    public void setId (Integer id) {
        this.put(KEY_ID, id);
    }
 
    public Integer getId () {
        return (Integer) this.get(KEY_ID);
    }
 
    public void setBusinessTime(Date date) {
        this.put(KEY_BUSINESS_TIME, date);
    }
 
    public <T> List<T> getRuntimeData(Class<T> clazz) {
        return JSON.parseArray((String)this.get(KEY_RUNTIME_DATA), clazz);
    }
 
    public void setSnippetIndex (Integer index) {
        this.put(KEY_SNIPPET_INDEX, index);
    }
 
    public Integer getSnippetIndex () {
        Object indexObject = this.get(KEY_SNIPPET_INDEX);
        if (indexObject == null) {
            return null;
        }
        return (Integer) indexObject;
    }
 
    public void setTriggerType (String triggerType) {
        this.put(KEY_TRIGGER_TYPE, triggerType);
    }
 
    public String getTriggerType () {
        return (String) this.get(KEY_TRIGGER_TYPE);
    }
 
    public Date getBusinessTime() {
        return (Date) this.get(KEY_BUSINESS_TIME);
    }
 
    public void setRuntimeData(String runtimeData) {
        this.put(KEY_RUNTIME_DATA, runtimeData);
    }
}