From 1a01a66203604a1d0d714f79389e73b78813167b Mon Sep 17 00:00:00 2001 From: zhengyf Date: Mon, 11 Nov 2024 17:24:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BD=E7=9F=A5=EF=BC=9A=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/SupplierPluginInitializer.java | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java index a13470a9..08692cb9 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java @@ -280,9 +280,9 @@ public class SupplierPluginInitializer extends PluginBaseEntity { String def1 = null; String url = null; String custName = k;//客商名称 + //查询u8c客商基本档案 + BdCubasdocEntity bdCubasdocEntity = queryU8CEntityUtil.queryBdCubasdocByName(custName); try { - //查询u8c客商基本档案 - BdCubasdocEntity bdCubasdocEntity = queryU8CEntityUtil.queryBdCubasdocByName(custName); if (bdCubasdocEntity == null) { //新增 url = OverallConstant.getOverAllValue("custdocSaveCode"); @@ -295,18 +295,23 @@ public class SupplierPluginInitializer extends PluginBaseEntity { //拼接def1,如果存在则跳过转换,如果不存在则新增 // def1 = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.joining(",")); List def1_new = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.toList()); - String def1_old = bdCubasdocEntity.getDef1(); - String[] def1_split_old = def1_old.split(","); - // 将数组转换为列表 - List def1_all=new ArrayList<>(); - List def1_list_old = Arrays.asList(def1_split_old);//u8c里已有的def1 - def1_all.addAll(def1_list_old); - for (String s_new : def1_new) { - if (!def1_list_old.contains(s_new)) { - def1_all.add(s_new); + if(bdCubasdocEntity==null){ + def1 = String.join(",", def1_new); + }else { + String def1_old = bdCubasdocEntity.getDef1(); + String[] def1_split_old = def1_old.split(","); + // 将数组转换为列表 + List def1_all=new ArrayList<>(); + List def1_list_old = Arrays.asList(def1_split_old);//u8c里已有的def1 + def1_all.addAll(def1_list_old); + for (String s_new : def1_new) { + if (!def1_list_old.contains(s_new)) { + def1_all.add(s_new); + } } + def1 = String.join(",", def1_all); } - def1 = String.join(",", def1_all); + CustdocEntityDto parentvo = new CustdocEntityDto(); CustdocRequestVo CustdocEntityDto = new CustdocRequestVo(); @@ -351,7 +356,11 @@ public class SupplierPluginInitializer extends PluginBaseEntity { integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated()); integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); - integrationTaskLivingDetailsEntity.setNewSystemNumber(res_custdoc.getParentvo().getCustcode()); + if(bdCubasdocEntity!=null){ + integrationTaskLivingDetailsEntity.setNewSystemNumber(bdCubasdocEntity.getCustcode()); + }else { + integrationTaskLivingDetailsEntity.setNewSystemNumber(res_custdoc.getParentvo().getCustcode()); + } integrationTaskLivingDetailsEntity.setNewSystemPrimary(res_custdoc.getParentvo().getPk_cubasdoc()); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); } @@ -369,6 +378,9 @@ public class SupplierPluginInitializer extends PluginBaseEntity { integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated()); integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); + if(bdCubasdocEntity!=null){ + integrationTaskLivingDetailsEntity.setNewSystemNumber(bdCubasdocEntity.getCustcode()); + } saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); } }