chen.lin
12 小时以前 a56420ff2042a3f6b1e824341a717a28c692cad4
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
package com.vincent.rsf.server.api.controller.erp.params;
 
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
 
import java.util.Map;
 
/**
 * 库存查询明细条件参数(供ERP调用)
 * 对应open-api的InventoryQueryCondition
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
@Accessors(chain = true)
@ApiModel(value = "InventoryQueryConditionParam", description = "库存查询明细条件参数")
public class InventoryQueryConditionParam {
 
    /**
     * 仓库编码
     */
    @ApiModelProperty(value = "仓库编码")
    private String wareHouseId;
 
    /**
     * 库位编码
     */
    @ApiModelProperty(value = "库位编码")
    private String locId;
 
    /**
     * 物料编码
     */
    @ApiModelProperty(value = "物料编码")
    private String matNr;
 
    /**
     * 订单号/工单号/MES工单号
     */
    @ApiModelProperty(value = "订单号/工单号/MES工单号")
    private String orderNo;
 
    /**
     * 计划跟踪号
     */
    @ApiModelProperty(value = "计划跟踪号")
    private String planNo;
 
    /**
     * 批次号
     */
    @ApiModelProperty(value = "批次号")
    private String batch;
 
    /**
     * 物料组
     */
    @ApiModelProperty(value = "物料组")
    private String matGroup;
 
    /**
     * 从Map构造InventoryQueryConditionParam对象
     * 用于接收其他方法返回的Map参数并自动转换
     * 
     * @param map 查询条件Map
     * @return InventoryQueryConditionParam对象
     */
    public static InventoryQueryConditionParam fromMap(Map<String, Object> map) {
        if (map == null) {
            return null;
        }
        InventoryQueryConditionParam param = new InventoryQueryConditionParam();
        if (map.containsKey("wareHouseId")) {
            param.setWareHouseId((String) map.get("wareHouseId"));
        }
        if (map.containsKey("locId")) {
            param.setLocId((String) map.get("locId"));
        }
        if (map.containsKey("matNr")) {
            param.setMatNr((String) map.get("matNr"));
        }
        if (map.containsKey("orderNo")) {
            param.setOrderNo((String) map.get("orderNo"));
        }
        if (map.containsKey("planNo")) {
            param.setPlanNo((String) map.get("planNo"));
        }
        if (map.containsKey("batch")) {
            param.setBatch((String) map.get("batch"));
        }
        if (map.containsKey("matGroup")) {
            param.setMatGroup((String) map.get("matGroup"));
        }
        return param;
    }
 
    /**
     * 转换为Map(用于兼容需要Map参数的方法)
     * 
     * @return Map对象
     */
    public Map<String, Object> toMap() {
        Map<String, Object> map = new java.util.HashMap<>();
        if (wareHouseId != null) {
            map.put("wareHouseId", wareHouseId);
        }
        if (locId != null) {
            map.put("locId", locId);
        }
        if (matNr != null) {
            map.put("matNr", matNr);
        }
        if (orderNo != null) {
            map.put("orderNo", orderNo);
        }
        if (planNo != null) {
            map.put("planNo", planNo);
        }
        if (batch != null) {
            map.put("batch", batch);
        }
        if (matGroup != null) {
            map.put("matGroup", matGroup);
        }
        return map;
    }
}