物料导入优化

This commit is contained in:
李贵强 2025-03-04 13:24:41 +08:00
parent dddd798ad0
commit e7e7682a23
1 changed files with 8 additions and 3 deletions

View File

@ -46,9 +46,14 @@ public class ContractMaterialImportPlugin extends AbstractFormPlugin {
Map<BasedataItem, List<Object>> searchResult = e.getSearchResult();
for (Map.Entry<BasedataItem, List<Object>> entry : searchResult.entrySet()) {
List<Object> basedata = entry.getValue();
if (basedata.isEmpty()) { // 查不到基础资料数据
Long materialId = newMaterial(entry.getKey().getSearchValue(),materialList);
basedata.add(materialId);
// 查不到基础资料数据(导入基础资料类型会自动查找)
if (basedata.isEmpty()) {
String entityNumber = entry.getKey().getEntityNumber();
//只针对物料
if ("bd_material".equals(entityNumber)){
Long materialId = newMaterial(entry.getKey().getSearchValue(),materialList);
basedata.add(materialId);
}
} else {
// 查到多个基础资料数据
// 业务场景应根据需求剔除不合法的基础资料数据最终保留一个