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);