|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.digiwin.athena.app.service.supplier; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.nacos.common.utils.CollectionUtils; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.digiwin.app.service.DWEAIResult; |
|
|
|
import com.digiwin.athena.app.infra.entity.ItemSupplierEntity; |
|
|
@ -39,18 +40,20 @@ public class SupplierGetEAIService extends AbsEAIService { |
|
|
|
List<ItemSupplierEntity> supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); |
|
|
|
LambdaQueryWrapper<ItemSupplierEntity> lmq = new LambdaQueryWrapper<>(); |
|
|
|
lmq.eq(ItemSupplierEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); |
|
|
|
lmq.and( |
|
|
|
queryWrapperInner -> { |
|
|
|
for (ItemSupplierEntity itemSupplierEntity : supplierInfo) { |
|
|
|
queryWrapperInner.or( |
|
|
|
wrapper -> wrapper |
|
|
|
.eq(ItemSupplierEntity::getItemNo, itemSupplierEntity.getItemNo()) |
|
|
|
.eq(ItemSupplierEntity::getItemName, itemSupplierEntity.getItemName()) |
|
|
|
.eq(ItemSupplierEntity::getSupplierNo, itemSupplierEntity.getSupplierNo()) |
|
|
|
.eq(ItemSupplierEntity::getSupplierName, itemSupplierEntity.getSupplierName()) |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
if (CollectionUtils.isNotEmpty(supplierInfo)) { |
|
|
|
lmq.and( |
|
|
|
queryWrapperInner -> { |
|
|
|
for (ItemSupplierEntity itemSupplierEntity : supplierInfo) { |
|
|
|
queryWrapperInner.or( |
|
|
|
wrapper -> wrapper |
|
|
|
.eq(ItemSupplierEntity::getItemNo, itemSupplierEntity.getItemNo()) |
|
|
|
.eq(ItemSupplierEntity::getItemName, itemSupplierEntity.getItemName()) |
|
|
|
.eq(ItemSupplierEntity::getSupplierNo, itemSupplierEntity.getSupplierNo()) |
|
|
|
.eq(ItemSupplierEntity::getSupplierName, itemSupplierEntity.getSupplierName()) |
|
|
|
); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
List<ItemSupplierEntity> list = supplierService.list(lmq); |
|
|
|
return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", list)); |
|
|
|