From bfeb79a9687c5a23b6cec2d9fa6a6f791dfaf282 Mon Sep 17 00:00:00 2001 From: zhenggl Date: Mon, 4 Sep 2023 15:35:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8E=92=E9=99=A4=E6=9B=B4?= =?UTF-8?q?=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 --- .../mapper/PurchaseOrderDetailMapper.xml | 25 ++++++++++ ...PurchaseOrderAbnormalUpdateEAIService.java | 47 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml new file mode 100644 index 0000000..9a806bc --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/infra/mapper/PurchaseOrderDetailMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + UPDATE cim_purchase_order_detail + + abnormal_handle_plan = #{item.abnormal_handle_plan} + + ,purchase_date = #{item.purchaseDate} + + + ,expected_date = #{item.expectedDate} + + + where id = #{item.id} + + + + + diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java new file mode 100644 index 0000000..59e2ebe --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/purchase/PurchaseOrderAbnormalUpdateEAIService.java @@ -0,0 +1,47 @@ +package com.digiwin.athena.app.service.purchase; + +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.TypeReference; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.infra.entity.PurchaseOrderDetailEntity; +import com.digiwin.athena.app.infra.entity.SupplierContactEntity; +import com.digiwin.athena.app.infra.repository.PurchaseOrderDetailRepository; +import com.digiwin.athena.opt.common.eai.EAIRequest; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import lombok.extern.log4j.Log4j2; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @auther: zhenggl + * @date: 2023/9/4 + */ +@Log4j2 +@Service +public class PurchaseOrderAbnormalUpdateEAIService extends AbsEAIService { + + @Resource + PurchaseOrderDetailRepository purchaseOrderDetailRepository; + + @Override + public String getServiceName() { + return PurchaseUtil.DEMO_PURCHASE_ORDER_ABNORMAL_UPDATE; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + // 入参反序列化 + EAIRequest request = new EAIRequest(messageBody); + List purchaseOrderDetailEntities = request.getToList("purchase_order_info", PurchaseOrderDetailEntity.class); + purchaseOrderDetailRepository.updateAbnormalHandlePlan(purchaseOrderDetailEntities); + + return EAIUtil.buildEAIResult(new HashMap<>()); + } +}