|  | @@ -1,13 +1,20 @@
 | 
											
												
													
														|  |  package fi.em.formPlugin;
 |  |  package fi.em.formPlugin;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  import com.alibaba.druid.util.StringUtils;
 |  |  import com.alibaba.druid.util.StringUtils;
 | 
											
												
													
														|  | 
 |  | +import com.alibaba.dubbo.common.utils.CollectionUtils;
 | 
											
												
													
														|  | 
 |  | +import com.alibaba.fastjson.JSONObject;
 | 
											
												
													
														|  |  import kd.bos.dataentity.entity.DynamicObject;
 |  |  import kd.bos.dataentity.entity.DynamicObject;
 | 
											
												
													
														|  | 
 |  | +import kd.bos.dataentity.entity.DynamicObjectCollection;
 | 
											
												
													
														|  | 
 |  | +import kd.bos.entity.datamodel.events.BeforeImportEntryEventArgs;
 | 
											
												
													
														|  |  import kd.bos.entity.datamodel.events.ChangeData;
 |  |  import kd.bos.entity.datamodel.events.ChangeData;
 | 
											
												
													
														|  |  import kd.bos.entity.datamodel.events.PropertyChangedArgs;
 |  |  import kd.bos.entity.datamodel.events.PropertyChangedArgs;
 | 
											
												
													
														|  |  import kd.bos.form.plugin.AbstractFormPlugin;
 |  |  import kd.bos.form.plugin.AbstractFormPlugin;
 | 
											
												
													
														|  | 
 |  | +import kd.bos.form.plugin.importentry.resolving.ImportEntryData;
 | 
											
												
													
														|  |  import kd.bos.orm.query.QCP;
 |  |  import kd.bos.orm.query.QCP;
 | 
											
												
													
														|  |  import kd.bos.orm.query.QFilter;
 |  |  import kd.bos.orm.query.QFilter;
 | 
											
												
													
														|  |  import kd.bos.servicehelper.BusinessDataServiceHelper;
 |  |  import kd.bos.servicehelper.BusinessDataServiceHelper;
 | 
											
												
													
														|  | 
 |  | +import java.util.*;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  public class BusinessProcessingSplitPlugin extends AbstractFormPlugin {
 |  |  public class BusinessProcessingSplitPlugin extends AbstractFormPlugin {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -42,4 +49,36 @@ public class BusinessProcessingSplitPlugin extends AbstractFormPlugin {
 | 
											
												
													
														|  |              }
 |  |              }
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    @Override
 | 
											
												
													
														|  | 
 |  | +    public void beforeImportEntry(BeforeImportEntryEventArgs e) {
 | 
											
												
													
														|  | 
 |  | +        Map source = (Map) e.getSource();
 | 
											
												
													
														|  | 
 |  | +        Set<Map.Entry<String, List<ImportEntryData>>> entries = source.entrySet();
 | 
											
												
													
														|  | 
 |  | +        for (Map.Entry<String, List<ImportEntryData>> entry : entries) {
 | 
											
												
													
														|  | 
 |  | +            String entryName = entry.getKey();
 | 
											
												
													
														|  | 
 |  | +            if (StringUtils.equals(entryName, "nckd_entryentity61121")) {
 | 
											
												
													
														|  | 
 |  | +                List<ImportEntryData> entryEntityImportDataList = entry.getValue();
 | 
											
												
													
														|  | 
 |  | +                if (CollectionUtils.isEmpty(entryEntityImportDataList)) {
 | 
											
												
													
														|  | 
 |  | +                    return;
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                DynamicObjectCollection nckd_entryentity61121s =  this.getModel().getEntryEntity("nckd_entryentity61121");
 | 
											
												
													
														|  | 
 |  | +                Map<String, DynamicObject> entryMap = new HashMap<>();
 | 
											
												
													
														|  | 
 |  | +                for (DynamicObject dynamicObject : nckd_entryentity61121s) {
 | 
											
												
													
														|  | 
 |  | +                    entryMap.put(dynamicObject.getDynamicObject("nckd_basedatafield18").getString("number"), dynamicObject);
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +                Iterator<ImportEntryData> iterator = entryEntityImportDataList.iterator();
 | 
											
												
													
														|  | 
 |  | +                while (iterator.hasNext()) {
 | 
											
												
													
														|  | 
 |  | +                    ImportEntryData entryData = iterator.next();
 | 
											
												
													
														|  | 
 |  | +                    JSONObject jsonObject =  entryData.getData();
 | 
											
												
													
														|  | 
 |  | +                    String importNumber = jsonObject.getJSONObject("nckd_basedatafield18").getString("number");
 | 
											
												
													
														|  | 
 |  | +                    DynamicObject dynamicObject = entryMap.get(importNumber);
 | 
											
												
													
														|  | 
 |  | +                    if (dynamicObject != null){
 | 
											
												
													
														|  | 
 |  | +                        nckd_entryentity61121s.remove(dynamicObject);
 | 
											
												
													
														|  | 
 |  | +                    }
 | 
											
												
													
														|  | 
 |  | +                }
 | 
											
												
													
														|  | 
 |  | +            }
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  |  }
 |  |  }
 |