feat:选装、替换无字段跳过

This commit is contained in:
zzs 2024-12-20 11:38:54 +08:00
parent 415ef3506c
commit d7a5ebf2a2
2 changed files with 12 additions and 4 deletions

View File

@ -77,10 +77,13 @@ public class OptionalFormPlugIn extends AbstractFormPlugin implements Plugin {
model.setValue("yem_parameter", mechanical.getString("yem_parameter"), createRow); model.setValue("yem_parameter", mechanical.getString("yem_parameter"), createRow);
model.setValue("yem_remarke", mechanical.getString("yem_remarke"), createRow); model.setValue("yem_remarke", mechanical.getString("yem_remarke"), createRow);
model.setValue("yem_entryid", id, createRow); model.setValue("yem_entryid", id, createRow);
DynamicObject dataEntity = model.getDataEntity(true);
if (dataEntity.containsProperty("yem_model_config_c")) {
model.setValue("yem_model_config_c", mechanical.getDynamicObject("yem_model_config_c"), createRow); model.setValue("yem_model_config_c", mechanical.getDynamicObject("yem_model_config_c"), createRow);
} }
} }
} }
}
public void billFunction(Map<String, Object> customParams) { public void billFunction(Map<String, Object> customParams) {
@ -182,7 +185,8 @@ public class OptionalFormPlugIn extends AbstractFormPlugin implements Plugin {
parentModel.setValue("yem_remarkss", model.getValue("yem_remarke", selectRow), optionalRow); parentModel.setValue("yem_remarkss", model.getValue("yem_remarke", selectRow), optionalRow);
parentModel.setValue("yem_configentryid", model.getValue("yem_entryid", selectRow), optionalRow); parentModel.setValue("yem_configentryid", model.getValue("yem_entryid", selectRow), optionalRow);
DynamicObject modelConfigR = (DynamicObject) model.getValue("yem_model_config_c", optionalRow); DynamicObject modelConfigR = (DynamicObject) model.getValue("yem_model_config_c", optionalRow);
if (modelConfigR != null) { DynamicObject parentDataEntity = parentModel.getDataEntity(true);
if (modelConfigR != null && parentDataEntity.containsProperty("yem_cname_config") && parentDataEntity.containsProperty("yem_ename_config")) {
parentModel.setValue("yem_cname_config", modelConfigR.getString("yem_standard_cname"), optionalRow); parentModel.setValue("yem_cname_config", modelConfigR.getString("yem_standard_cname"), optionalRow);
parentModel.setValue("yem_ename_config", modelConfigR.getString("yem_standard_ename"), optionalRow); parentModel.setValue("yem_ename_config", modelConfigR.getString("yem_standard_ename"), optionalRow);
} }

View File

@ -6,6 +6,7 @@ import com.yem.wm.utils.FunctionalCommon;
import com.yem.wm.utils.YEM; import com.yem.wm.utils.YEM;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.MainEntityType;
import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.IDataModel;
import kd.bos.form.FormShowParameter; import kd.bos.form.FormShowParameter;
import kd.bos.form.IFormView; import kd.bos.form.IFormView;
@ -107,9 +108,11 @@ public class ReplaceFormPlugIn extends AbstractFormPlugin implements Plugin {
// model.setValue("yem_marketraiseprice", replaceable.getBigDecimal("yem_salesmarkup_re"), entryRow); // model.setValue("yem_marketraiseprice", replaceable.getBigDecimal("yem_salesmarkup_re"), entryRow);
model.setValue("yem_remarke", replaceable.getString("yem_remarkr"), entryRow); model.setValue("yem_remarke", replaceable.getString("yem_remarkr"), entryRow);
model.setValue("yem_entryid", replaceable.getPkValue(), entryRow); model.setValue("yem_entryid", replaceable.getPkValue(), entryRow);
if (model.getDataEntity(true).containsProperty("yem_model_config_r")) {
model.setValue("yem_model_config_r", replaceable.getDynamicObject("yem_model_config_r"), entryRow); model.setValue("yem_model_config_r", replaceable.getDynamicObject("yem_model_config_r"), entryRow);
} }
} }
}
} }
@ -172,7 +175,8 @@ public class ReplaceFormPlugIn extends AbstractFormPlugin implements Plugin {
parentModel.setValue("yem_remarkss", model.getValue("yem_remarke", selectRow), optionalRow); parentModel.setValue("yem_remarkss", model.getValue("yem_remarke", selectRow), optionalRow);
parentModel.setValue("yem_configentryid", model.getValue("yem_entryid", selectRow), optionalRow); parentModel.setValue("yem_configentryid", model.getValue("yem_entryid", selectRow), optionalRow);
DynamicObject modelConfigR = (DynamicObject) model.getValue("yem_model_config_r", optionalRow); DynamicObject modelConfigR = (DynamicObject) model.getValue("yem_model_config_r", optionalRow);
if (modelConfigR != null) { DynamicObject parentDataEntity = parentModel.getDataEntity(true);
if (modelConfigR != null && parentDataEntity.containsProperty("yem_cname_config") && parentDataEntity.containsProperty("yem_ename_config")) {
parentModel.setValue("yem_cname_config", modelConfigR.getString("yem_standard_cname"), optionalRow); parentModel.setValue("yem_cname_config", modelConfigR.getString("yem_standard_cname"), optionalRow);
parentModel.setValue("yem_ename_config", modelConfigR.getString("yem_standard_ename"), optionalRow); parentModel.setValue("yem_ename_config", modelConfigR.getString("yem_standard_ename"), optionalRow);
} }