| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | 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);
|
| | | }
|
| | |
|
| | | }
|