diff --git a/src/main/java/com/yem/wm/es/shippingdetails/op/XshippingDetailsSaveOp.java b/src/main/java/com/yem/wm/es/shippingdetails/op/XshippingDetailsSaveOp.java new file mode 100644 index 00000000..37689588 --- /dev/null +++ b/src/main/java/com/yem/wm/es/shippingdetails/op/XshippingDetailsSaveOp.java @@ -0,0 +1,85 @@ +package com.yem.wm.es.shippingdetails.op; + +import com.alibaba.csp.sentinel.util.StringUtil; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; +import kd.bos.entity.plugin.AbstractOperationServicePlugIn; +import kd.bos.entity.plugin.PreparePropertysEventArgs; +import kd.bos.entity.plugin.args.BeforeOperationArgs; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +/** + * @author ljw + * @date 2024/11/8 17:42 + * @description XshippingDetailsSaveOp + */ +public class XshippingDetailsSaveOp extends AbstractOperationServicePlugIn { + @Override + public void onPreparePropertys(PreparePropertysEventArgs e) { + e.getFieldKeys().addAll(this.billEntityType.getAllFields().keySet()); + } + + @Override + public void beforeExecuteOperationTransaction(BeforeOperationArgs e) { + super.beforeExecuteOperationTransaction(e); + DynamicObject[] eDataEntities = e.getDataEntities(); + for (int i = 0; i < eDataEntities.length; i++) { + DynamicObject dataEntitie = eDataEntities[i]; + DynamicObjectCollection collects = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total"); + DynamicObjectCollection followcars = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_p"); + Map map = new HashMap<>(); + for (DynamicObject followcar : followcars) { + DynamicObject yemAccesmaterial = followcar.getDynamicObject("yem_accesmaterial"); + if (yemAccesmaterial != null) { +// long aLong = yemAccesmaterial.getLong("id"); +// if (map.get(aLong)!=null){ +// map.put(aLong,followcar); +// }else { + +// DynamicObject[] dynamicObjects = map.get(aLong); +// DynamicObject[] objects = {}; +// for (DynamicObject dynamicObject : dynamicObjects) { +// } +// map.put(aLong,dynamicObjects) +// } +// if (!collects.isEmpty()) { +// for (DynamicObject dynamicObject : collects) { +// DynamicObject[] decimal = map.get(dynamicObject.getLong("yem_accesmaterial_tl.id")); +// if (decimal != null) { +// DynamicObject newEntryEntity = collects.addNew(); +// newEntryEntity.set("yem_isgifit_tl", true); +// newEntryEntity.set("yem_classification_tl", "A"); +// if (followcar.getDynamicObject("yem_accessorytype") != null) { +// newEntryEntity.set("yem_basicmodel_tl", followcar.getLong("yem_accessorytype.id")); +// } +// if (StringUtil.isNotEmpty(followcar.getString("yem_volvotype"))) { +// newEntryEntity.set("yem_volvotype_tl", followcar.getString("yem_volvotype")); +// } +// if (followcar.getDynamicObject("yem_accesmaterial") != null) { +// newEntryEntity.set("yem_accesmaterial_tl", followcar.getLong("yem_accesmaterial.id")); +// newEntryEntity.set("yem_materialname_tl", followcar.getString("yem_accesmaterial.name")); +// newEntryEntity.set("yem_materialenname_tl", followcar.getString("yem_accesmaterial.yem_nameen")); +// newEntryEntity.set("yem_specification_tl", followcar.getString("yem_accesmaterial.modelnum")); +// } +// if (followcar.getDynamicObject("yem_acunit") != null) { +// newEntryEntity.set("yem_acunit_tl", followcar.getLong("yem_acunit.id")); +// newEntryEntity.set("yem_unitfieldbase_tl", followcar.getLong("yem_acunit.id")); +// } +// if (StringUtil.isNotEmpty(followcar.getString("yem_saleorderno_p"))) { +// newEntryEntity.set("yem_constratnb_tl", followcar.getString("yem_saleorderno_p")); +// } +// newEntryEntity.set("yem_qty_tl", followcar.getBigDecimal("yem_acallqty")); +// newEntryEntity.set("yem_qtybase_tl", followcar.getBigDecimal("yem_acallqty")); +// newEntryEntity.set("yem_constracteyid_tl", followcar.getLong("yem_constracteyid_p")); +// newEntryEntity.set("yem_constractioid_tl", followcar.getLong("id")); +// +// } +// } + } + } + } + } +} diff --git a/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit_wl.java b/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit_wl.java index dd436bc2..5c6f94ea 100644 --- a/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit_wl.java +++ b/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit_wl.java @@ -212,7 +212,7 @@ public class StorageTransEdit_wl extends AbstractBillPlugIn { boonle = false; i++; } - if (yemStation == null) { + if ("".equals(yemStation)) { string = string + i + ". 场站为空,请稍后重试!\n"; boonle = false; i++; @@ -313,7 +313,7 @@ public class StorageTransEdit_wl extends AbstractBillPlugIn { boonle = false; i++; } - if (yemStation == null) { + if ("".equals(yemStation)) { string = string + i + ". 场站为空,请稍后重试!\n"; boonle = false; i++; @@ -326,7 +326,7 @@ public class StorageTransEdit_wl extends AbstractBillPlugIn { i++; } if (yemInitforecdate == null) { - string = string + i + ". 预计船期为空,请稍后重试!\n"; + string = string + i + ". 物流预计船期/班列为空,请稍后重试!\n"; boonle = false; i++; }