ErpMaterial.java
2.84 KB
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
package com.huaheng.api.general.domain;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.apache.commons.lang.StringEscapeUtils;
import java.math.BigDecimal;
@Data
public class ErpMaterial {
/**条码值**/
@JSONField(name = "BarCode")
public String BarCode;
/**条码类型**/
@JSONField(name = "BarType")
public String BarType;
/**物料编码**/
@JSONField(name = "MaterialCode")
public String MaterialCode;
/**物料名称**/
@JSONField(name = "MaterialName")
public String MaterialName;
/**物料规格**/
@JSONField(name = "MaterialSpec")
public String MaterialSpec;
/**批号**/
@JSONField(name = "BatchNo")
public String BatchNo;
/**物料单位**/
@JSONField(name = "MaterialUnit")
public String MaterialUnit;
/**条码数量**/
@JSONField(name = "BarQty")
public BigDecimal BarQty;
/**来源单别**/
@JSONField(name = "SourceBillType")
public String SourceBillType;
/**来源单号**/
@JSONField(name = "SourceBillCode")
public String SourceBillCode;
/**来源行号**/
@JSONField(name = "SourceBillLine")
public String SourceBillLine;
/**客户/供应商编号**/
@JSONField(name = "CustOrSupplyCode")
public String CustOrSupplyCode;
/**客户/供应商名称**/
@JSONField(name = "CustOrSupplyName")
public String CustOrSupplyName;
/**客户品号**/
@JSONField(name = "CustMatCode")
public String CustMatCode;
/**客户规格**/
@JSONField(name = "CustMatName")
public String CustMatName;
public static ErpMaterial parse(String msg){
String json = StringEscapeUtils.unescapeJava(msg);
ErpMaterial obj = JSON.parseObject(json, ErpMaterial.class);
return obj;
}
public String toRawJsonStr(){
String s = JSON.toJSONString(this);
// System.out.println(StringEscapeUtils.escapeJava(s));
return s;
}
public static void main(String args[]){
String s = "{\"BarCode\":\"181110002691\",\"BarType\":\"2\",\"MaterialCode\":\"AH0010008006\",\"MaterialName\":\"PA 单体PA Driver\",\"MaterialSpec\":\"LDSAT82LS\",\"BatchNo\":\"********************\",\"MaterialUnit\":\"pcs\",\"BarQty\":1.000000,\"SourceBillType\":\"5101\",\"SourceBillCode\":\"82411191973\",\"SourceBillLine\":\"\",\"SaleBillType\":\"2201\",\"SaleBillCode\":\"20180821005\",\"SaleBillLine\":\"0002\",\"CustOrSupplyCode\":\"00023\",\"CustOrSupplyName\":\"AH\",\"CustMatCode\":\"\",\"CustMatName\":\"\",\"CustMatSpec\":\"\",\"Remarks\":\"\",\"BarProperty\":\"M\",\"TaskBillType\":\"\",\"TaskBillCode\":\"\",\"EffectiveDate\":\"2021-03-05 18:15:38\",\"ManufacturingDate\":\"2018-11-10 00:00:00\",\"RecheckDate\":\"1900-01-01 00:00:00\"}";
ErpMaterial obj = ErpMaterial.parse(s);
obj.toRawJsonStr();
}
}