From d92302db56e30d5ac0c0b9c753fc95a882668644 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 4 Sep 2023 15:33:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=96=E5=8D=8F=E4=BE=9B=E5=BA=94=E5=95=86ge?= =?UTF-8?q?t=E4=BF=AE=E6=94=B9,=E5=BC=82=E5=B8=B8=E6=8E=92=E9=99=A4?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/PurchaseOrderDetailEntity.java | 3 +++ .../PurchaseOrderDetailRepository.java | 5 ++++ .../app/provider/PurchaseDemoEAIService.java | 5 ++-- .../impl/PurchaseDemoEAIServiceImpl.java | 5 ++++ .../app/service/purchase/PurchaseUtil.java | 3 +++ .../supplier/SupplierGetEAIService.java | 27 ++++++++++--------- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java index 8bd0f15..1f4c056 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/entity/PurchaseOrderDetailEntity.java @@ -3,6 +3,7 @@ package com.digiwin.athena.app.infra.entity; import com.baomidou.mybatisplus.annotation.TableName; import com.digiwin.athena.opt.persistence.domain.BaseMgrEntity; +import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.annotations.SerializedName; import lombok.AllArgsConstructor; import lombok.Builder; @@ -102,12 +103,14 @@ public class PurchaseOrderDetailEntity extends BaseMgrEntity { + + public void updateAbnormalHandlePlan(@Param("list") List list); } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java index 8c67163..234233e 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/PurchaseDemoEAIService.java @@ -21,5 +21,6 @@ public interface PurchaseDemoEAIService extends DWService { @EAIService(id = PurchaseUtil.DEMO_PURCHASE_DEMO_GET) DWEAIResult get(Map headers, String messageBody) throws Exception; - -} \ No newline at end of file + @EAIService(id = PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE) + DWEAIResult abnormalUpdate(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java index 87a0f4a..24a12ec 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/PurchaseDemoEAIServiceImpl.java @@ -29,4 +29,9 @@ public class PurchaseDemoEAIServiceImpl implements PurchaseDemoEAIService { public DWEAIResult get(Map headers, String messageBody) throws Exception { return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_DEMO_GET, headers, messageBody); } + + @Override + public DWEAIResult abnormalUpdate(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE, headers, messageBody); + } } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java index 7dde132..cbced95 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseUtil.java @@ -15,5 +15,8 @@ public class PurchaseUtil { //查询请购单 public static final String DEMO_PURCHASE_DEMO_GET = "demo.purchase.order.get"; + //异常排除更新 + public static final String DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE = "demo.purchase.order.abnormal.update"; + } diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java index e8fbe5b..345bc51 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierGetEAIService.java @@ -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 supplierInfo = eaiRequest.getObject("item_supplier_info", SupplierUtil.LIST_ENTITY_SUPPLIER); LambdaQueryWrapper 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 list = supplierService.list(lmq); return EAIUtil.buildEAIResult(new JSONObject().fluentPut("item_supplier_info", list));