From 6b02223ae9c193e4fb04e5c6ea48e76e4b60cb32 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期三, 27 十二月 2023 09:57:34 +0800 Subject: [PATCH] # --- src/main/java/com/zy/common/model/DetlDto.java | 77 +++++++++++++++++++++++++------------- 1 files changed, 51 insertions(+), 26 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..b0b3fbb 100644 --- a/src/main/java/com/zy/common/model/DetlDto.java +++ b/src/main/java/com/zy/common/model/DetlDto.java @@ -2,6 +2,7 @@ import com.core.common.Cools; import com.zy.asrs.entity.OrderDetl; +import com.zy.asrs.entity.param.OpenOrderPakinJDParam; import lombok.Data; import java.util.List; @@ -13,7 +14,6 @@ @Data public class DetlDto { - private String orderNo; private String matnr; @@ -21,7 +21,22 @@ private Double anfme; + private int owner; + private String ownerName; + + private int payment; + + private Double weight; + public DetlDto() { + } + + public DetlDto(OpenOrderPakinJDParam.DetlDto2 detlDto2) { + this.matnr=detlDto2.getMatnr(); + this.batch=detlDto2.getBatch(); + this.anfme=detlDto2.getAnfme(); + this.ownerName=detlDto2.getOwner(); + this.payment=0; } public DetlDto(String matnr, Double anfme) { @@ -29,18 +44,48 @@ 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; + this.owner = 0; } - public DetlDto(String orderNo, String matnr, String batch, Double anfme) { - this.orderNo = orderNo; + public DetlDto(String matnr, String batch, Double anfme,int owner) { this.matnr = matnr; this.batch = batch; this.anfme = anfme; + this.owner = owner; } + + public DetlDto(String matnr, String batch, Double anfme,int owner,Double weight) { + this.matnr = matnr; + this.batch = batch; + this.anfme = anfme; + this.owner = owner; + this.weight = weight; + } + + public DetlDto(String matnr, String batch, Double anfme,Double weight) { + this.matnr = matnr; + this.batch = batch; + this.anfme = anfme; + this.weight = weight; + } + + public DetlDto(String matnr, String batch, Double anfme,String ownerName,int payment) { + this.matnr = matnr; + this.batch = batch; + this.anfme = anfme; + this.ownerName = ownerName; + this.payment = payment; + } + public static boolean hasList(Set<DetlDto> detlDtos, OrderDetl orderDetl) { for (DetlDto dto : detlDtos) { @@ -61,16 +106,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 +118,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