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字段,转换为空字符串