From 005827136eeb432ca8b68925ffaf86b6b95c4a84 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 06 十二月 2023 20:18:37 +0800
Subject: [PATCH] #盘点修改

---
 src/main/java/com/zy/common/model/DetlDto.java |   68 +++++++++++++++++++++------------
 1 files changed, 43 insertions(+), 25 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..d58542b 100644
--- a/src/main/java/com/zy/common/model/DetlDto.java
+++ b/src/main/java/com/zy/common/model/DetlDto.java
@@ -15,11 +15,20 @@
 
     private String orderNo;
 
+    //鏂欐兂鐮�
+    private String containerCode;
+
     private String matnr;
 
     private String batch;
 
     private Double anfme;
+
+    //閿�鍞鍗曞彿
+    private String csocode;
+
+    //閿�鍞鍗曡鍙�
+    private String isoseq;
 
     public DetlDto() {
     }
@@ -29,17 +38,33 @@
         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) {
+    public DetlDto(String matnr, String batch, Double anfme, String csocode, String isoseq, String containerCode) {
+        this.matnr = matnr;
+        this.batch = batch;
+        this.anfme = anfme;
+        this.csocode = csocode;
+        this.isoseq = isoseq;
+        this.containerCode = containerCode;
+    }
+
+    public DetlDto(String orderNo, String matnr, String batch, Double anfme, String csocode, String isoseq) {
         this.orderNo = orderNo;
         this.matnr = matnr;
         this.batch = batch;
         this.anfme = anfme;
+        this.csocode = csocode;
+        this.isoseq = isoseq;
     }
 
     public static boolean hasList(Set<DetlDto> detlDtos, OrderDetl orderDetl) {
@@ -61,43 +86,36 @@
 
     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.getContainerCode(), detlDto.getContainerCode())
+                    && Cools.eq(dto.getBatch(), detlDto.getBatch())
+                    && Cools.eq(dto.getCsocode(),detlDto.getCsocode())
+                    && Cools.eq(dto.getIsoseq(),detlDto.getIsoseq())) {
+                return true;
             }
         }
         return false;
     }
 
-    public static DetlDto find(List<DetlDto> detlDtos, String matnr, String batch) {
+    public static DetlDto find(List<DetlDto> detlDtos, String matnr, String batch, String csocode, String isoseq, String containerCode) {
         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(containerCode, detlDto.getContainerCode())
+                    && Cools.eq(batch, detlDto.getBatch())
+                    && Cools.eq(csocode,detlDto.getCsocode())
+                    && Cools.eq(isoseq,detlDto.getIsoseq())) {
                 return detlDto;
             }
         }
         return null;
     }
 
+    public static void main(String[] args) {
+        boolean a = Cools.eq("a", null);
+        System.out.println(a);
+    }
+
 }

--
Gitblit v1.9.1