合同导入触发报错bug

This commit is contained in:
李贵强 2025-02-18 16:01:30 +08:00
parent db2fbda76f
commit 99659e0273
1 changed files with 23 additions and 13 deletions

View File

@ -4,10 +4,13 @@ import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSONObject;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.metadata.IDataEntityType;
import kd.bos.dataentity.utils.StringUtils;
import kd.bos.entity.datamodel.BasedataItem;
import kd.bos.entity.datamodel.events.BeforeImportEntryEventArgs;
import kd.bos.entity.datamodel.events.QueryImportBasedataEventArgs;
import kd.bos.entity.plugin.ImportLogger;
import kd.bos.form.operate.webapi.RowMapper;
import kd.bos.form.plugin.AbstractFormPlugin;
import kd.bos.form.plugin.importentry.resolving.ImportEntryData;
import kd.bos.form.plugin.impt.BatchImportPlugin;
@ -35,6 +38,11 @@ public class ContractMaterialImportPlugin extends AbstractFormPlugin {
@Override
public void queryImportBasedata(QueryImportBasedataEventArgs e) {
super.queryImportBasedata(e);
DynamicObject targetObj = ((RowMapper) e.getSource()).getTargetObj();
IDataEntityType dataEntityType = targetObj.getDataEntityType();
if (null!=dataEntityType){
String name = dataEntityType.getName();
if (StringUtils.equals("qeug_orderformentry",name)){
Map<BasedataItem, List<Object>> searchResult = e.getSearchResult();
for (Map.Entry<BasedataItem, List<Object>> entry : searchResult.entrySet()) {
List<Object> basedata = entry.getValue();
@ -52,6 +60,8 @@ public class ContractMaterialImportPlugin extends AbstractFormPlugin {
}
}
}
}
}
private Long newMaterial(String number,Set<ImportMaterial> set){
ImportMaterial materialByNumber = getMaterialByNumber(number, set);