skyouc
2024-12-21 c635d78b479510ebe2556a420948effcd30a0731
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
package com.zy.asrs.wms.asrs.entity.template;
 
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.zy.asrs.common.utils.Synchro;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
 
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
 
@Data
public class MatTemplate {
 
    //一级分类
    @ApiModelProperty(value= "一级分类")
    private String firstTag;
 
    //二级分类
    @ApiModelProperty(value= "二级分类")
    private String secondTag;
 
    //商品编号
    @ApiModelProperty(value= "商品编号")
    private String matnr;
 
    //商品名称
    @ApiModelProperty(value= "商品名称")
    private String maktx;
 
    //别名
    @ApiModelProperty(value= "别名")
    private String name;
 
    //规格
    @ApiModelProperty(value= "规格")
    private String specs;
 
    //型号
    @ApiModelProperty(value= "型号")
    private String model;
 
    //颜色
    @ApiModelProperty(value= "颜色")
    private String color;
 
    //品牌
    @ApiModelProperty(value= "品牌")
    private String brand;
 
    //单位
    @ApiModelProperty(value= "单位")
    private String unit;
 
    //单价
    @ApiModelProperty(value= "单价")
    private Double price;
 
    //sku
    @ApiModelProperty(value= "sku")
    private String sku;
 
    //单位量
    @ApiModelProperty(value= "单位量")
    private String units;
 
    //条码
    @ApiModelProperty(value= "条码")
    private String barcode;
 
    //产地
    @ApiModelProperty(value= "产地")
    private String origin;
 
    //厂家
    @ApiModelProperty(value= "厂家")
    private String manu;
 
    //生产日期
    @ApiModelProperty(value= "生产日期")
    private String manuDate;
 
    //品项数
    @ApiModelProperty(value= "品项数")
    private String itemNum;
 
    //重量
    @ApiModelProperty(value= "重量")
    private String weight;
 
    //长度
    @ApiModelProperty(value= "长度")
    private String length;
 
    //体积
    @ApiModelProperty(value= "体积")
    private String volume;
 
    //三方编码
    @ApiModelProperty(value= "三方编码")
    private String threeCode;
 
    //供应商
    @ApiModelProperty(value= "供应商")
    private String supp;
 
    //供应商编码
    @ApiModelProperty(value= "供应商编码")
    private String suppCode;
 
    //保质期
    @ApiModelProperty(value= "保质期")
    private String deadTime;
 
    //安全库存上限
    @ApiModelProperty(value= "安全库存上限")
    private Double safeStockLimit;
 
    //安全库存下限
    @ApiModelProperty(value= "安全库存下限")
    private Double safeStockMinimum;
 
    //有效期
    @ApiModelProperty(value= "有效期")
    private String validity;
 
    //备注
    @ApiModelProperty(value= "备注")
    private String memo;
 
    public void sync(Object source) {
        Synchro.Copy(source, this);
    }
 
    //动态扩展字段
    public transient Map<String, Object> dynamicFields = new HashMap<>();
 
    @JsonAnyGetter
    public Map<String,Object> getDynamicFields() {
        return dynamicFields;
    }
 
    public void syncFieldMap(Map<String, Object> map) {
        ArrayList<String> keys = new ArrayList<>();
        Field[] fields = this.getClass().getDeclaredFields();
        for (Field field : fields) {
            keys.add(field.getName());
        }
        keys.add("detlId");
 
        Map<String, Object> dynamicFields = new HashMap<>();
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            if (keys.contains(entry.getKey())) {
                continue;
            }
            dynamicFields.put(entry.getKey(), entry.getValue());
        }
 
        this.dynamicFields = dynamicFields;
    }
 
    public String getFieldString(String key) {
        return dynamicFields.get(key).toString();
    }
 
    public void setField(String key, Object value) {
        dynamicFields.put(key, value);
    }
 
}