From 5005df18425435d936479ec9ea50cc40cd6099f4 Mon Sep 17 00:00:00 2001 From: clong <1584238099@qq.com> Date: Mon, 4 Sep 2023 15:47:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplier/SupplierContactInfoGetEAIService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java index 9728b04..c7e61bd 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java @@ -2,7 +2,6 @@ package com.digiwin.athena.app.service.supplier; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.digiwin.app.service.DWEAIResult; import com.digiwin.athena.app.infra.entity.SupplierContactEntity; import com.digiwin.athena.app.infra.service.SupplierContactInfoService; @@ -10,11 +9,12 @@ import com.digiwin.athena.opt.common.eai.EAIUtil; import com.digiwin.athena.opt.common.eai.service.AbsEAIService; import com.digiwin.athena.opt.common.security.SecurityUtil; import lombok.extern.log4j.Log4j2; -import org.apache.commons.lang3.StringUtils; import org.json.JSONArray; import org.json.JSONObject; import org.springframework.stereotype.Service; + + import javax.annotation.Resource; import java.util.List; import java.util.Map; @@ -44,10 +44,12 @@ public class SupplierContactInfoGetEAIService extends AbsEAIService { JSONObject parameter = new JSONObject(messageBody).getJSONObject("std_data").getJSONObject("parameter"); JSONArray jsonArray = parameter.getJSONArray("contact_info"); - LambdaQueryWrapper queryWrapper = Wrappers.lambdaQuery() - .eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()) - .in(!StringUtils.isEmpty(jsonArray.getJSONObject(0).get("supplier_no").toString()), - SupplierContactEntity::getSupplierNo, jsonArray.getJSONObject(0).get("supplier_no")); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper(); + queryWrapper.eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId()); + + if(!jsonArray.isNull(0)) { + queryWrapper.in(SupplierContactEntity::getSupplierNo, jsonArray.getJSONObject(0).get("supplier_no")); + } List list = supplierContactInfoService.list(queryWrapper);