Browse Source

修改代码

master
clong 1 year ago
parent
commit
5005df1842
1 changed files with 8 additions and 6 deletions
  1. +8
    -6
      demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java

+ 8
- 6
demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/service/supplier/SupplierContactInfoGetEAIService.java View File

@ -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<SupplierContactEntity> queryWrapper = Wrappers.<SupplierContactEntity>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<SupplierContactEntity> queryWrapper = new LambdaQueryWrapper<SupplierContactEntity>();
queryWrapper.eq(SupplierContactEntity::getTenantId, SecurityUtil.getUserProfile().getTenantId());
if(!jsonArray.isNull(0)) {
queryWrapper.in(SupplierContactEntity::getSupplierNo, jsonArray.getJSONObject(0).get("supplier_no"));
}
List<SupplierContactEntity> list = supplierContactInfoService.list(queryWrapper);


Loading…
Cancel
Save