From ef020398c02bee9a22e8fa045eeb0eea53bcc8fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Wed, 15 Nov 2023 17:34:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=9D=9E=E7=A9=BA?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/PurchaseDemoGetService.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java index d79d3bd..7e011d8 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java @@ -49,22 +49,24 @@ public class PurchaseDemoGetService extends AbsEAIService { //根据请购单号+请购单序号+状态+任务卡类型查询 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(PurchaseOrderDetailEntity::getTenantSid, SecurityUtil.getUserProfile().getTenantSid()); - queryWrapper.and( - queryWrapperInner -> { - for (PurchaseOrderDetailEntity purchaseOrderDetail : purchaseInfos) { - queryWrapperInner.or( - wrapper -> wrapper - .eq(!StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderNo()), PurchaseOrderDetailEntity::getPurchaseOrderNo, purchaseOrderDetail.getPurchaseOrderNo()) - .eq(!StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderSeq()), PurchaseOrderDetailEntity::getPurchaseOrderSeq, purchaseOrderDetail.getPurchaseOrderSeq()) - .eq(!StringUtils.isEmpty(purchaseOrderDetail.getTabStatus()), PurchaseOrderDetailEntity::getTabStatus, purchaseOrderDetail.getTabStatus()) - .eq(!StringUtils.isEmpty(purchaseOrderDetail.getAbnormalTabStatus()), PurchaseOrderDetailEntity::getAbnormalTabStatus, purchaseOrderDetail.getAbnormalTabStatus()) - .eq(!StringUtils.isEmpty(purchaseOrderDetail.getReplyTabStatus()), PurchaseOrderDetailEntity::getReplyTabStatus, purchaseOrderDetail.getReplyTabStatus()) - .eq(!StringUtils.isEmpty(purchaseOrderDetail.getTaskType()), PurchaseOrderDetailEntity::getTaskType, purchaseOrderDetail.getTaskType()) + if (purchaseInfos != null && !purchaseInfos.isEmpty()) { + queryWrapper.and( + queryWrapperInner -> { + for (PurchaseOrderDetailEntity purchaseOrderDetail : purchaseInfos) { + queryWrapperInner.or( + wrapper -> wrapper + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderNo()), PurchaseOrderDetailEntity::getPurchaseOrderNo, purchaseOrderDetail.getPurchaseOrderNo()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getPurchaseOrderSeq()), PurchaseOrderDetailEntity::getPurchaseOrderSeq, purchaseOrderDetail.getPurchaseOrderSeq()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getTabStatus()), PurchaseOrderDetailEntity::getTabStatus, purchaseOrderDetail.getTabStatus()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getAbnormalTabStatus()), PurchaseOrderDetailEntity::getAbnormalTabStatus, purchaseOrderDetail.getAbnormalTabStatus()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getReplyTabStatus()), PurchaseOrderDetailEntity::getReplyTabStatus, purchaseOrderDetail.getReplyTabStatus()) + .eq(!StringUtils.isEmpty(purchaseOrderDetail.getTaskType()), PurchaseOrderDetailEntity::getTaskType, purchaseOrderDetail.getTaskType()) - ); + ); + } } - } - ); + ); + } List entities = purchaseOrderDetailRepository.selectList(queryWrapper); //String类型的null字段,转换为空字符串