1. 同步主数据物料时,需要控制批次大小
This commit is contained in:
@@ -75,6 +75,9 @@ public class MasterDataSyncServiceImpl implements MasterDataSyncService {
|
||||
if (!properties.isEnabled()) {
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.MASTER_DATA_SYNC_DISABLED);
|
||||
}
|
||||
if (command.getBatchSize() > 1000) {
|
||||
throw ServiceExceptionUtil.exception(ErrorCodeConstants.MASTER_DATA_SYNC_BATCH_SIZE_TOO_LARGE, command.getBatchSize());
|
||||
}
|
||||
MasterDataSyncReport report = MasterDataSyncReport.start(command);
|
||||
List<String> materialCodes = sanitizeCodes(command.getMaterialCodes());
|
||||
report.setMaterialCodes(materialCodes);
|
||||
@@ -306,7 +309,11 @@ public class MasterDataSyncServiceImpl implements MasterDataSyncService {
|
||||
continue;
|
||||
}
|
||||
MaterialInfomationDO current = existingById.get(codeId);
|
||||
String name = normalizeValue(item.getMaterialName());
|
||||
// 名称优先取 MDM 的长描述(desclong),若为空再回退到 desc1
|
||||
String name = normalizeValue(item.getLongDescription());
|
||||
if (name == null) {
|
||||
name = normalizeValue(item.getMaterialName());
|
||||
}
|
||||
if (current == null) {
|
||||
MaterialInfomationDO created = MaterialInfomationDO.builder()
|
||||
.id(codeId)
|
||||
|
||||
Reference in New Issue
Block a user