P15GEN2\59518
2024-05-29 d4210c7c4b04abde20037ea8aa0f54ef8a2649aa
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
package foundation.ai.dao;
 
import com.alibaba.fastjson.JSONObject;
 
import foundation.json.IJSONProvider;
import foundation.json.IJSONWriter;
 
public class InvoiceVerificationDetailDao implements IJSONProvider {
    
    private String lineNo;
    private String code;
    private String name;
    private String productCode;
    private String productName;
    private String spec;
    private String unit;
    private String qty;
    private String price;
    private String taxRate;
    private String amtBeforeTax;
    private String amtTax;
    private String amtAfterTax;
    private String classifyCodeTax;
    private boolean isBelong; 
 
    public void parse(JSONObject jsonObject) {
        name = jsonObject.getString("goodsName");
        code = jsonObject.getString("goodsCode");
        spec = jsonObject.getString("specModel");
        unit = jsonObject.getString("unit");
        qty = jsonObject.getString("num");
        price = jsonObject.getString("unitPrice");
        taxRate = jsonObject.getString("taxRate");
        amtBeforeTax = jsonObject.getString("detailAmount");
        amtTax = jsonObject.getString("taxAmount");
        double amtAfterTaxValue = jsonObject.getDoubleValue("amtTax") + jsonObject.getDoubleValue("detailAmount");
        amtAfterTax = Double.toString(amtAfterTaxValue);
        classifyCodeTax = jsonObject.getString("classifyCodeTax");
    }
    
    public String getLineNo() {
        return lineNo;
    }
 
    public void setLineNo(String lineNo) {
        this.lineNo = lineNo;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getSpec() {
        return spec;
    }
 
    public void setSpec(String spec) {
        this.spec = spec;
    }
 
    public String getUnit() {
        return unit;
    }
 
    public void setUnit(String unit) {
        this.unit = unit;
    }
 
    public String getQty() {
        return qty;
    }
 
    public void setQty(String qty) {
        this.qty = qty;
    }
 
    public String getPrice() {
        return price;
    }
 
    public void setPrice(String price) {
        this.price = price;
    }
 
    public String getTaxRate() {
        return taxRate;
    }
 
    public void setTaxRate(String taxRate) {
        this.taxRate = taxRate;
    }
 
    public String getAmtBeforeTax() {
        return amtBeforeTax;
    }
 
    public void setAmtBeforeTax(String amtBeforeTax) {
        this.amtBeforeTax = amtBeforeTax;
    }
 
    public String getAmtTax() {
        return amtTax;
    }
 
    public void setAmtTax(String amtTax) {
        this.amtTax = amtTax;
    }
 
    public String getAmtAfterTax() {
        return amtAfterTax;
    }
 
    public void setAmtAfterTax(String amtAfterTax) {
        this.amtAfterTax = amtAfterTax;
    }
 
    public String getClassifyCodeTax() {
        return classifyCodeTax;
    }
 
    public void setClassifyCodeTax(String classifyCodeTax) {
        this.classifyCodeTax = classifyCodeTax;
    }
 
    public boolean isBelong() {
        return isBelong;
    }
 
    public void setBelong(boolean isBelong) {
        this.isBelong = isBelong;
    }
    
    public String getProductCode() {
        return productCode;
    }
 
    public String getProductName() {
        return productName;
    }
 
    @Override
    public void writeJSON(IJSONWriter writer) {
        writer.beginObject();
        
        writer.write("line_no", lineNo);
        writer.write("name", name);
        writer.write("code", code);
        writer.write("spec", spec);
        writer.write("unit", unit);
        writer.write("qty", qty);
        writer.write("price", price);
        writer.write("tax_rate", taxRate);
        writer.write("amt_before_tax", amtBeforeTax);
        writer.write("amt_tax", amtTax);
        writer.write("amt_after_tax", amtAfterTax);
        writer.write("classifycode_tax", classifyCodeTax);
        writer.write("is_belong", isBelong);
        
        writer.endObject();
    }
 
}