Browse Source

feat:更新查询功能,增加非空校验

李壮壮 1 year ago
parent
commit
ef020398c0
1 changed files with 16 additions and 14 deletions
  1. +16
    -14
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java

+ 16
- 14
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseDemoGetService.java View File

@ -49,22 +49,24 @@ public class PurchaseDemoGetService extends AbsEAIService {
//根据请购单号+请购单序号+状态+任务卡类型查询
LambdaQueryWrapper<PurchaseOrderDetailEntity> 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<PurchaseOrderDetailEntity> entities = purchaseOrderDetailRepository.selectList(queryWrapper);
//String类型的null字段转换为空字符串


Loading…
Cancel
Save