From fda29d9e367713444d73de2d3737dddeab8d6684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A3=AE=E5=A3=AE?= Date: Mon, 29 Apr 2024 13:19:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:demo.athenaopt.requirement.info.get?= =?UTF-8?q?=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../QuotationRequirementEAIService.java | 29 +++++ .../QuotationRequirementEAIServiceImpl.java | 27 +++++ .../QuotationRequirementInfoGetService.java | 109 ++++++++++++++++++ .../app/service/quotation/QuotationUtil.java | 15 +++ 4 files changed, 180 insertions(+) create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/QuotationRequirementEAIService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/QuotationRequirementEAIServiceImpl.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationRequirementInfoGetService.java create mode 100644 demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationUtil.java diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/QuotationRequirementEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/QuotationRequirementEAIService.java new file mode 100644 index 0000000..f498bf6 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/QuotationRequirementEAIService.java @@ -0,0 +1,29 @@ +package com.digiwin.athena.app.provider; + +import com.digiwin.app.service.AllowAnonymous; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.app.service.DWService; +import com.digiwin.app.service.eai.EAIService; +import com.digiwin.athena.app.service.quotation.QuotationUtil; + +import java.util.Map; + +/** + * @author lz + * @version 1.0 + * @title QuotationRequirementEAIService + * @description + * @create 2024/4/29 10:20 + */ +public interface QuotationRequirementEAIService extends DWService { + + /** + * 报价需求查询 + * @param headers + * @param messageBody + * @return + * @throws Exception + */ + @EAIService(id = QuotationUtil.DEMO_ATHENAOPT_REQUIREMENT_INFO_GET) + DWEAIResult get(Map headers, String messageBody) throws Exception; +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/QuotationRequirementEAIServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/QuotationRequirementEAIServiceImpl.java new file mode 100644 index 0000000..2a1da06 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/QuotationRequirementEAIServiceImpl.java @@ -0,0 +1,27 @@ +package com.digiwin.athena.app.provider.impl; + +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.app.provider.QuotationRequirementEAIService; +import com.digiwin.athena.app.service.quotation.QuotationUtil; +import com.digiwin.athena.opt.common.eai.service.EAIServiceContext; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * @author lz + * @version 1.0 + * @title PurchaseDemoEAIServiceImpl + * @description + * @create 2023/8/30 16:50 + */ +public class QuotationRequirementEAIServiceImpl implements QuotationRequirementEAIService { + + @Resource + private EAIServiceContext eaiServiceContext; + + @Override + public DWEAIResult get(Map headers, String messageBody) throws Exception { + return eaiServiceContext.execute(QuotationUtil.DEMO_ATHENAOPT_REQUIREMENT_INFO_GET , headers, messageBody); + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationRequirementInfoGetService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationRequirementInfoGetService.java new file mode 100644 index 0000000..25f10c1 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationRequirementInfoGetService.java @@ -0,0 +1,109 @@ +package com.digiwin.athena.app.service.quotation; + +import com.alibaba.fastjson.JSONObject; +import com.digiwin.app.service.DWEAIResult; +import com.digiwin.athena.opt.common.eai.EAIUtil; +import com.digiwin.athena.opt.common.eai.service.AbsEAIService; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @author lz + * @version 1.0 + * @title QuotationRequirement + * @description mock需求数据 + * @create 2024/4/29 10:00 + */ +@Service +public class QuotationRequirementInfoGetService extends AbsEAIService { + + @Override + public String getServiceName() { + return QuotationUtil.DEMO_ATHENAOPT_REQUIREMENT_INFO_GET; + } + + @Override + public DWEAIResult execute(Map headers, String messageBody) throws Exception { + + List> requirementInfo = getRequirementInfo(); + + return EAIUtil.buildEAIResult(new JSONObject().fluentPut("requirement_info", requirementInfo)); + } + + + /** + * @description mock需求数据 + * @author lz + * @throws + * @time 2024/4/29 10:16 + */ + public static List> getRequirementInfo() { + List> requirementInfo = new ArrayList<>(); + + // 第一个需求 + Map requirement1 = new HashMap<>(); + List correlationCode1 = Arrays.asList("100203"); + requirement1.put("correlation_code", correlationCode1); + requirement1.put("requirement_no", "100203"); + requirement1.put("requirement_name", "产品色"); + requirement1.put("requirement_description", ""); + requirementInfo.add(requirement1); + + // 第二个需求 + Map requirement2 = new HashMap<>(); + List correlationCode2 = Arrays.asList("100203", "1-1"); + requirement2.put("correlation_code", correlationCode2); + requirement2.put("requirement_no", "100203"); + requirement2.put("requirement_name", "是否定制-客户定制色或工厂标准色"); + requirement2.put("requirement_description", ""); + requirementInfo.add(requirement2); + + // 第三个需求 + Map requirement3 = new HashMap<>(); + List correlationCode3 = Arrays.asList("100203", "2-1"); + requirement3.put("correlation_code", correlationCode3); + requirement3.put("requirement_no", "100203"); + requirement3.put("requirement_name", "产品色系-2"); + requirement3.put("requirement_description", ""); + requirementInfo.add(requirement3); + + // 第四个需求 + Map requirement4 = new HashMap<>(); + List correlationCode4 = Arrays.asList("100203", "3-1"); + requirement4.put("correlation_code", correlationCode4); + requirement4.put("requirement_no", "100203"); + requirement4.put("requirement_name", "每色MOQ-2"); + requirement4.put("requirement_description", ""); + requirementInfo.add(requirement4); + + // 第五个需求 + Map requirement5 = new HashMap<>(); + List correlationCode5 = Arrays.asList("100203", "4-1"); + requirement5.put("correlation_code", correlationCode5); + requirement5.put("requirement_no", "100203"); + requirement5.put("requirement_name", "是否有文件,若有,需附上文件-2"); + requirement5.put("requirement_description", ""); + requirementInfo.add(requirement5); + + // 第六个需求 + Map requirement6 = new HashMap<>(); + List correlationCode6 = Arrays.asList("100204"); + requirement6.put("correlation_code", correlationCode6); + requirement6.put("requirement_no", "100203"); + requirement6.put("requirement_name", "是否有文件,若有,需附上文件-2"); + requirement6.put("requirement_description", ""); + requirementInfo.add(requirement6); + + // 第七个需求 + Map requirement7 = new HashMap<>(); + List correlationCode7 = Arrays.asList("100204", "5-1"); + requirement7.put("correlation_code", correlationCode7); + requirement7.put("requirement_no", "100204"); + requirement7.put("requirement_name", "需求名称"); + requirement7.put("requirement_description", ""); + requirementInfo.add(requirement7); + + return requirementInfo; + } +} diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationUtil.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationUtil.java new file mode 100644 index 0000000..8cd2009 --- /dev/null +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/quotation/QuotationUtil.java @@ -0,0 +1,15 @@ +package com.digiwin.athena.app.service.quotation; + +/** + * @author lz + * @version 1.0 + * @title QuotationUtil + * @description + * @create 2024/4/29 10:01 + */ +public class QuotationUtil { + + public static final String DEMO_ATHENAOPT_REQUIREMENT_INFO_GET= "demo.athenaopt.requirement.info.get"; + + +}