地质所 沉降监测网建设项目
chenhuan
2024-05-16 0fdd42e318f51f9e3c6581473416af1cca69877f
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
package com.javaweb.third.baidu.bean.ocr;
 
 
import com.alibaba.fastjson.JSONObject;
import com.javaweb.third.baidu.bean.BaseResult;
 
 
/**
 * 驾驶证识别
 * @author wujiyue
 */
public class DriveLicenseOcrResult extends BaseResult {
 
 
    private String words_result_num;
    private Integer direction;
 
    private String type;//准假车型 C1
    private String ID;//证号
    private String starttime;//有效期限 始
    private String endtime;//有效期限 止
    private String name;//
    private String birthday;
    private String country;
    private String gender;
    private String firstTime;
    private String address;
 
    public DriveLicenseOcrResult(String json){
        this.setJson(json);
        try{
            JSONObject jsonObject= JSONObject.parseObject(json);
            String e_code=jsonObject.getString("error_code");
            if(notNull(e_code)){
                this.setError_code(e_code);
                String e_msg=jsonObject.getString("error_msg");
                this.setError_msg(e_msg);
                this.setRequestOk(false);
            }else {
                this.setRequestOk(true);
                this.setLog_id(jsonObject.getString("log_id"));
                this.words_result_num=jsonObject.getString("words_result_num");
                this.direction=jsonObject.getInteger("direction");
                JSONObject words_result_json=jsonObject.getJSONObject("words_result");
                this.type = words_result_json.getJSONObject("准驾车型").getString("words");
                this.name = words_result_json.getJSONObject("姓名").getString("words");
                this.starttime=words_result_json.getJSONObject("有效期限").getString("words");
                this.endtime=words_result_json.getJSONObject("至").getString("words");
                this.birthday=words_result_json.getJSONObject("出生日期").getString("words");
                this.ID=words_result_json.getJSONObject("证号").getString("words");
                this.gender=words_result_json.getJSONObject("性别").getString("words");
                this.country=words_result_json.getJSONObject("国籍").getString("words");
                this.firstTime=words_result_json.getJSONObject("初次领证日期").getString("words");
                this.address=words_result_json.getJSONObject("住址").getString("words");
 
 
            }
        }catch (Exception ex){
            ex.printStackTrace();
            this.setRequestOk(false);
            this.setError_msg("解析json字符串出现异常!");
        }
    }
    public static DriveLicenseOcrResult create(String jsonStr) {
        return new DriveLicenseOcrResult(jsonStr);
    }
 
    @Override
    public String toString() {
        return "DriveLicenseOcrResult{" +
                "words_result_num='" + words_result_num + '\'' +
                ", direction=" + direction +
                ", type='" + type + '\'' +
                ", ID='" + ID + '\'' +
                ", starttime='" + starttime + '\'' +
                ", endtime='" + endtime + '\'' +
                ", name='" + name + '\'' +
                ", birthday='" + birthday + '\'' +
                ", country='" + country + '\'' +
                ", gender='" + gender + '\'' +
                ", firstTime='" + firstTime + '\'' +
                ", address='" + address + '\'' +
                '}';
    }
 
    public String getAddress() {
        return address;
    }
 
    public void setAddress(String address) {
        this.address = address;
    }
 
    public String getWords_result_num() {
        return words_result_num;
    }
 
    public void setWords_result_num(String words_result_num) {
        this.words_result_num = words_result_num;
    }
 
    public Integer getDirection() {
        return direction;
    }
 
    public void setDirection(Integer direction) {
        this.direction = direction;
    }
 
    public String getType() {
        return type;
    }
 
    public void setType(String type) {
        this.type = type;
    }
 
    public String getID() {
        return ID;
    }
 
    public void setID(String ID) {
        this.ID = ID;
    }
 
    public String getStarttime() {
        return starttime;
    }
 
    public void setStarttime(String starttime) {
        this.starttime = starttime;
    }
 
    public String getEndtime() {
        return endtime;
    }
 
    public void setEndtime(String endtime) {
        this.endtime = endtime;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getBirthday() {
        return birthday;
    }
 
    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
 
    public String getCountry() {
        return country;
    }
 
    public void setCountry(String country) {
        this.country = country;
    }
 
    public String getGender() {
        return gender;
    }
 
    public void setGender(String gender) {
        this.gender = gender;
    }
 
    public String getFirstTime() {
        return firstTime;
    }
 
    public void setFirstTime(String firstTime) {
        this.firstTime = firstTime;
    }
}