丽知:供应商同步修改。

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 def1 = null;
String url = null; String url = null;
String custName = k;//客商名称 String custName = k;//客商名称
try {
//查询u8c客商基本档案 //查询u8c客商基本档案
BdCubasdocEntity bdCubasdocEntity = queryU8CEntityUtil.queryBdCubasdocByName(custName); BdCubasdocEntity bdCubasdocEntity = queryU8CEntityUtil.queryBdCubasdocByName(custName);
try {
if (bdCubasdocEntity == null) { if (bdCubasdocEntity == null) {
//新增 //新增
url = OverallConstant.getOverAllValue("custdocSaveCode"); url = OverallConstant.getOverAllValue("custdocSaveCode");
@ -295,6 +295,9 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
//拼接def1,如果存在则跳过转换如果不存在则新增 //拼接def1,如果存在则跳过转换如果不存在则新增
// def1 = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.joining(",")); // def1 = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.joining(","));
List<String> def1_new = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.toList()); List<String> def1_new = v.stream().map(OfsSupplierDto::getBizCode).collect(Collectors.toList());
if(bdCubasdocEntity==null){
def1 = String.join(",", def1_new);
}else {
String def1_old = bdCubasdocEntity.getDef1(); String def1_old = bdCubasdocEntity.getDef1();
String[] def1_split_old = def1_old.split(","); String[] def1_split_old = def1_old.split(",");
// 将数组转换为列表 // 将数组转换为列表
@ -307,6 +310,8 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
} }
} }
def1 = String.join(",", def1_all); def1 = String.join(",", def1_all);
}
CustdocEntityDto parentvo = new CustdocEntityDto(); CustdocEntityDto parentvo = new CustdocEntityDto();
CustdocRequestVo CustdocEntityDto = new CustdocRequestVo(); CustdocRequestVo CustdocEntityDto = new CustdocRequestVo();
@ -351,7 +356,11 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated()); integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated());
integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode()); integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
if(bdCubasdocEntity!=null){
integrationTaskLivingDetailsEntity.setNewSystemNumber(bdCubasdocEntity.getCustcode());
}else {
integrationTaskLivingDetailsEntity.setNewSystemNumber(res_custdoc.getParentvo().getCustcode()); integrationTaskLivingDetailsEntity.setNewSystemNumber(res_custdoc.getParentvo().getCustcode());
}
integrationTaskLivingDetailsEntity.setNewSystemPrimary(res_custdoc.getParentvo().getPk_cubasdoc()); integrationTaskLivingDetailsEntity.setNewSystemPrimary(res_custdoc.getParentvo().getPk_cubasdoc());
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} }
@ -369,6 +378,9 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated()); integrationTaskLivingDetailsEntity.setRootAppPk(ofsSupplierDto.getBizCode() + "_" + ofsSupplierDto.getLastUpdated());
integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode()); integrationTaskLivingDetailsEntity.setRootAppBill(ofsSupplierDto.getBizCode());
integrationTaskLivingDetailsEntity.setPluginId(getPluginId()); integrationTaskLivingDetailsEntity.setPluginId(getPluginId());
if(bdCubasdocEntity!=null){
integrationTaskLivingDetailsEntity.setNewSystemNumber(bdCubasdocEntity.getCustcode());
}
saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity); saveOrUpdateBusinessLogUtil.saveOrUpdate(integrationTaskLivingDetailsEntity);
} }
} }