puzhibing
2025-04-25 9ac1967a101b233ca7552984f9de0f7f96bb3218
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
package com.ruoyi.dataInterchange.model;
 
import com.ruoyi.dataInterchange.pojo.BaseModel;
import com.ruoyi.dataInterchange.util.jtt809.common.Jtt809Util;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
 
/**
 * 时效口令上报
 *
 * @author zhibing.pu
 * @Date 2025/3/21 9:27
 */
@Data
@Document(indexName = "up_authorize_msg")
public class UPAuthorizeMsgStartup extends BaseModel {
    /**
     * 子业务类型标识
     */
    @Field(type = FieldType.Integer)
    private int dataType;
    /**
     * 企业视频监控平台唯一编码
     */
    @Field(type = FieldType.Text)
    private String plateformId;
    /**
     * 附属地政府平台使用的时效口令
     */
    @Field(type = FieldType.Text)
    private String authorizeCode1;
    /**
     * 跨域地区政府平台使用的时效口令
     */
    @Field(type = FieldType.Text)
    private String authorizeCode2;
    
    
    /**
     * 解析登录报文
     */
    public UPAuthorizeMsgStartup decode(ByteBuf byteBuf) {
        try {
            this.dataType = byteBuf.readShort();
            this.plateformId = Jtt809Util.readGBKString(byteBuf, 11);
            this.authorizeCode1 = Jtt809Util.readGBKString(byteBuf, 64);
            this.authorizeCode2 = Jtt809Util.readGBKString(byteBuf, 64);
        }catch (Exception e){
            e.printStackTrace();
        }
        return this;
    }
}