P15GEN2\59518
2025-10-10 9f6890646993d16260d4201d613c092132856127
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
package foundation.icall.callout.ai;
 
import java.util.List;
 
import foundation.json.IJSONProvider;
import foundation.json.IJSONWriter;
import foundation.util.Util;
 
public class OCRResult implements IJSONProvider {
 
    private String traceId;
    private String errcode;
    private String json;
    private String description;    
    private boolean is_real;
    private boolean is_bill;
    private List<InvoiceVerificationDao> invoiceList;
    
    public OCRResult(String json) {
        this.json = json;
    }
 
    public String getTraceId() {
        return traceId;
    }
 
    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }
 
    public String getErrcode() {
        return errcode;
    }
 
    public void setErrcode(String errcode) {
        this.errcode = errcode;
    }
 
    public String getJson() {
        return json;
    }
 
    public boolean isIs_real() {
        return is_real;
    }
 
    public void setIs_real(boolean is_real) {
        this.is_real = is_real;
    }
 
    public boolean isIs_bill() {
        return is_bill;
    }
 
    public void setIs_bill(boolean is_bill) {
        this.is_bill = is_bill;
    }
 
    public void setJson(String json) {
        this.json = json;
    }
    
    public String getDescription() {
        return description;
    }
 
    public void setDescription(String description) {
        this.description = description;
    }
 
    public void setInvoiceList(List<InvoiceVerificationDao> invoiceList) {
        this.invoiceList = invoiceList;
    }
 
    @Override
    public void writeJSON(IJSONWriter writer) {
        writer.beginObject();
        
        //1. operator
        writer.write("errcode", errcode);
        writer.write("traceId", traceId);
        writer.write("description", description);
        
        //2. content
        if (json == null) {
            writer.writeNull("content");
            writer.write("is_real", is_real);
            writer.write("is_bill", is_bill);
        }
        else if (!Util.isEmpty(json) && json instanceof String) {
            writer.write("content", json);
            writer.write("is_real", is_real);
            writer.write("is_bill", is_bill);
        }
        else {
            writer.writeName("content");
            writer.writeJSON(json);
            writer.write("is_real", is_real);
            writer.write("is_bill", is_bill);
            
        }        
        
        writer.beginArray("invoiceList");
        if(invoiceList != null && invoiceList.size() > 0 ) {        
            
            for (InvoiceVerificationDao invoice : invoiceList) {
                invoice.writeJSON(writer);
            }
            
        }
        writer.endArray();
        
        writer.endObject();
    }
 
}