From 41012324d4afa371ac50d45e3e93e802cf8d6e28 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 16 五月 2023 08:42:02 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/model/DetlDto.java |   40 ++++++++++------------------------------
 1 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/src/main/java/com/zy/common/model/DetlDto.java b/src/main/java/com/zy/common/model/DetlDto.java
index e2e8bb3..0a38646 100644
--- a/src/main/java/com/zy/common/model/DetlDto.java
+++ b/src/main/java/com/zy/common/model/DetlDto.java
@@ -13,13 +13,14 @@
 @Data
 public class DetlDto {
 
-    private String orderNo;
 
     private String matnr;
 
     private String batch;
 
     private Double anfme;
+
+    private Double weight;
 
     public DetlDto() {
     }
@@ -29,18 +30,17 @@
         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) {
@@ -61,16 +61,8 @@
 
     public static boolean has(List<DetlDto> detlDtos, DetlDto detlDto) {
         for (DetlDto dto : detlDtos) {
-            if (Cools.isEmpty(dto.getBatch()) && Cools.isEmpty(detlDto.getBatch())) {
-                if (dto.getMatnr().equals(detlDto.getMatnr())) {
-                    return true;
-                }
-            } else {
-                if (!Cools.isEmpty(dto.getBatch()) && !Cools.isEmpty(detlDto.getBatch())) {
-                    if (dto.getMatnr().equals(detlDto.getMatnr()) && dto.getBatch().equals(detlDto.getBatch())) {
-                        return true;
-                    }
-                }
+            if (dto.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(dto.getBatch(), detlDto.getBatch())) {
+                return true;
             }
         }
         return false;
@@ -81,19 +73,7 @@
             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;
             }
         }

--
Gitblit v1.9.1