| | |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | |
| | | 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) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static DetlDto find(Set<DetlDto> detlDtos, String matnr, String batch) { |
| | | 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())) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public static DetlDto find(List<DetlDto> detlDtos, String matnr, String batch) { |
| | | if (Cools.isEmpty(matnr)) { |
| | | return null; |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | if (!matnr.equals(detlDto.getMatnr())) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(batch) && Cools.isEmpty(detlDto.getBatch())) { |
| | | return detlDto; |
| | | } |
| | | if (Cools.isEmpty(batch) && !Cools.isEmpty(detlDto.getBatch())) { |
| | | continue; |
| | | } |
| | | if (Cools.isEmpty(detlDto.getBatch()) && !Cools.isEmpty(batch)) { |
| | | continue; |
| | | } |
| | | if (batch.equals(detlDto.getBatch())) { |
| | | if (matnr.equals(detlDto.getMatnr()) && Cools.eq(batch, detlDto.getBatch())) { |
| | | return detlDto; |
| | | } |
| | | } |