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
package foundation.icall.callout.ai;
 
import foundation.data.entity.Entity;
import foundation.data.object.DataObject;
import foundation.json.IJSONProvider;
import foundation.json.IJSONWriter;
import foundation.json.JSONReader;
 
public class InvoiceVerificationDetailDao implements IJSONProvider {
    private DataObject dataObject = DataObject.getInstance("temp_so_implant_invoice_detail");
    private Entity entity;
    private String batchId; 
    private String parentId; 
    private boolean isBelong; 
 
    public InvoiceVerificationDetailDao(String batchId, String parentId) {
        this.batchId = batchId;
        this.parentId = parentId;
    }
 
    public void parse(JSONReader jsonObject) throws Exception {
        Entity entity = new Entity(dataObject.getTableFieldMetas());
        entity.set("batch_id", batchId);
        entity.set("parent_id", parentId);
        entity.set("line_no", jsonObject.getString("lineNo"));
        entity.set("name", jsonObject.getString("goodsName"));
        entity.set("code", jsonObject.getString("goodsCode"));
        entity.set("spec", jsonObject.getString("specModel"));
        entity.set("unit", jsonObject.getString("unit"));
        entity.set("qty", jsonObject.getString("num"));
        entity.set("price", jsonObject.getString("unitPrice"));
        entity.set("tax_rate", jsonObject.getString("taxRate"));
        entity.set("amt_tax", jsonObject.getString("taxAmount"));
        entity.set("classify_code_tax", jsonObject.getString("classifyCodeTax"));
        
        String amtBeforeTax = jsonObject.getString("detailAmount");
        entity.set("amt_before_tax", amtBeforeTax);
        double amtTax = Double.valueOf(jsonObject.getString("amtTax"));
        
        double detailAmount = Double.valueOf(amtBeforeTax);
        double amtAfterTaxValue = amtTax + detailAmount;
        entity.set("amt_after_tax", Double.toString(amtAfterTaxValue));
        this.entity = entity;
        
        isBelong = jsonObject.getBoolean("isBelong", true);
    }
 
    public Entity getEntity() {
        return entity;
    }
 
    public String getName() {
        return entity.getString("name");
    }
    
    public boolean isBelong() {
        return isBelong;
    }
 
    public void setBelong(boolean isBelong) {
        this.isBelong = isBelong;
    }
    
    public void writeJSON(IJSONWriter writer) {
        entity.writeJSON(writer);
    }
}