自动化立体仓库 - WMS系统
#
lsh
2024-12-21 7658be06a4f6ed1ed24c41d7c5a2f0602ffbe660
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
package com.zy.common.model;
 
import com.core.common.Cools;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.entity.OrderDetlPakin;
import com.zy.asrs.entity.OrderDetlPakout;
import lombok.Data;
 
import java.util.List;
import java.util.Set;
 
/**
 * Created by vincent on 2022/3/25
 */
@Data
public class DetlDto {
 
    private String orderNo;
 
    private String matnr;
 
    private String batch = "";
    private String brand = "";
    private String standby1 = "";
    private String standby2 = "";
    private String standby3 = "";
    private Long lineNumber = 1L;
 
    private Double anfme;
 
    public DetlDto() {
    }
 
    public DetlDto(String matnr, String batch, String brand, String standby1, String standby2, String standby3, Long lineNumber, Double anfme) {
        this.matnr = matnr;
        this.batch = batch;
        this.brand = brand;
        this.standby1 = standby1;
        this.standby2 = standby2;
        this.standby3 = standby3;
        this.lineNumber = lineNumber;
        this.anfme = anfme;
    }
 
    public DetlDto(String matnr, String batch, String brand, String standby1, String standby2, String standby3, Double anfme) {
        this.matnr = matnr;
        this.batch = batch;
        this.brand = brand;
        this.standby1 = standby1;
        this.standby2 = standby2;
        this.standby3 = standby3;
        this.anfme = anfme;
    }
 
    public DetlDto(String matnr, String batch, String brand, String standby1, String standby2, String standby3, Long lineNumber) {
        this.matnr = matnr;
        this.batch = batch;
        this.brand = brand;
        this.standby1 = standby1;
        this.standby2 = standby2;
        this.standby3 = standby3;
        this.lineNumber = lineNumber;
    }
 
    public DetlDto(String matnr, String batch, String brand, String standby1, String standby2, String standby3) {
        this.matnr = matnr;
        this.batch = batch;
        this.brand = brand;
        this.standby1 = standby1;
        this.standby2 = standby2;
        this.standby3 = standby3;
    }
 
    public DetlDto(String matnr, Double anfme) {
        this.matnr = matnr;
        this.anfme = anfme;
    }
 
    public DetlDto(String matnr, String batch) {
        this.matnr = matnr;
        this.batch = batch;
    }
 
    public DetlDto(String matnr, String batch, Double anfme) {
        this.matnr = matnr;
        this.batch = batch;
        this.anfme = anfme;
    }
 
    public DetlDto(String orderNo, String matnr, String batch, Double anfme) {
        this.orderNo = orderNo;
        this.matnr = matnr;
        this.batch = batch;
        this.anfme = anfme;
    }
 
    public static boolean hasList(Set<DetlDto> detlDtos, OrderDetl orderDetl) {
        for (DetlDto dto : detlDtos) {
//            if (Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(orderDetl.getBatch())) {
//                if (dto.getMatnr().equals(orderDetl.getMatnr())) {
//                    return true;
//                }
//            } else
//            {
//                if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(orderDetl.getBatch())) {
//                    if (dto.getMatnr().equals(orderDetl.getMatnr()) && dto.getBatch().equals(orderDetl.getBatch())) {
//                        return true;
//                    }
            if (dto.getMatnr().equals(orderDetl.getMatnr()) && Cools.eq(dto.getBatch(), orderDetl.getBatch())
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())) {
                return true;
            }
//                }
//            }
        }
        return false;
    }
 
    public static boolean hasListLineNumber(Set<DetlDto> detlDtos, OrderDetl orderDetl) {
        for (DetlDto dto : detlDtos) {
//            if (Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(orderDetl.getBatch())) {
//                if (dto.getMatnr().equals(orderDetl.getMatnr())) {
//                    return true;
//                }
//            } else
//            {
//                if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(orderDetl.getBatch())) {
//                    if (dto.getMatnr().equals(orderDetl.getMatnr()) && dto.getBatch().equals(orderDetl.getBatch())) {
//                        return true;
//                    }
            if (dto.getMatnr().equals(orderDetl.getMatnr()) && Cools.eq(dto.getBatch(), orderDetl.getBatch())
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())
                    && dto.getLineNumber().equals(orderDetl.getLineNumber())) {
                return true;
            }
//                }
//            }
        }
        return false;
    }
 
    public static boolean hasList(Set<DetlDto> detlDtos, OrderDetlPakin orderDetl) {
        for (DetlDto dto : detlDtos) {
            if (dto.getMatnr().equals(orderDetl.getMatnr()) && Cools.eq(dto.getBatch(), orderDetl.getBatch())
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())) {
                return true;
            }
        }
        return false;
    }
 
    public static boolean hasList(Set<DetlDto> detlDtos, OrderDetlPakout orderDetl) {
        for (DetlDto dto : detlDtos) {
            if (dto.getMatnr().equals(orderDetl.getMatnr()) && Cools.eq(dto.getBatch(), orderDetl.getBatch())
                    && Cools.eq(dto.getBrand(), orderDetl.getBrand()) && Cools.eq(dto.getStandby1(), orderDetl.getStandby1())
                    && Cools.eq(dto.getStandby2(), orderDetl.getStandby2()) && Cools.eq(dto.getStandby3(), orderDetl.getStandby3())) {
                return true;
            }
        }
        return false;
    }
 
    public static boolean has(List<DetlDto> detlDtos, DetlDto detlDto) {
        for (DetlDto dto : detlDtos) {
            if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch())
                    && Cools.eq(dto.getBrand(), detlDto.getBrand()) && Cools.eq(dto.getStandby1(), detlDto.getStandby1())
                    && Cools.eq(dto.getStandby2(), detlDto.getStandby2()) && Cools.eq(dto.getStandby3(), detlDto.getStandby3())) {
                return true;
            }
        }
        return false;
    }
 
    public static DetlDto find(List<DetlDto> detlDtos, String matnr, String batch, String brand, String standby1, String standby2, String standby3) {
        if (Cools.isEmpty(matnr)) {
            return null;
        }
        for (DetlDto detlDto : detlDtos) {
            if (matnr.equals(detlDto.getMatnr()) && Cools.eq(batch, detlDto.getBatch())
                    && brand.equals(detlDto.getBrand()) && standby1.equals(detlDto.getStandby1())
                    && standby2.equals(detlDto.getStandby2()) && standby3.equals(detlDto.getStandby3())) {
                return detlDto;
            }
        }
        return null;
    }
 
    public static DetlDto findLineNumber(List<DetlDto> detlDtos, String matnr, String batch, String brand, String standby1, String standby2, String standby3,Long lineNumber) {
        if (Cools.isEmpty(matnr)) {
            return null;
        }
        for (DetlDto detlDto : detlDtos) {
            if (matnr.equals(detlDto.getMatnr()) && Cools.eq(batch, detlDto.getBatch())
                    && brand.equals(detlDto.getBrand()) && standby1.equals(detlDto.getStandby1())
                    && standby2.equals(detlDto.getStandby2()) && standby3.equals(detlDto.getStandby3())
                    && lineNumber.equals(detlDto.getLineNumber())) {
                return detlDto;
            }
        }
        return null;
    }
 
    public static DetlDto findDto(List<DetlDto> detlDtos,DetlDto detlDtoB) {
        if (Cools.isEmpty(detlDtoB)) {
            return null;
        }
        for (DetlDto detlDto : detlDtos) {
            if (detlDtoB.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(detlDtoB.getBatch(), detlDto.getBatch())
                    && detlDtoB.getBrand().equals(detlDto.getBrand()) && detlDtoB.getStandby1().equals(detlDto.getStandby1())
                    && detlDtoB.getStandby2().equals(detlDto.getStandby2()) && detlDtoB.getStandby3().equals(detlDto.getStandby3())) {
                return detlDto;
            }
        }
        return null;
    }
 
}