丽知:供应商同步修改。

This commit is contained in:
zhengyf 2024-11-11 17:24:08 +08:00
parent bc7556e1ee
commit 1a01a66203
1 changed files with 25 additions and 13 deletions

View File

@ -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<String> def1_new = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.toList());
String def1_old = bdCubasdocEntity.getDef1();
String[] def1_split_old = def1_old.split(",");
// 将数组转换为列表
List<String> def1_all=new ArrayList<>();
List<String> 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<String> def1_all=new ArrayList<>();
List<String> 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);
}
}