1.发运明细变更单保存生成出运明细
This commit is contained in:
ljw 2024-11-11 10:03:55 +08:00
parent 59cef79f81
commit 7964860624

View File

@ -30,54 +30,48 @@ public class XshippingDetailsSaveOp extends AbstractOperationServicePlugIn {
DynamicObject dataEntitie = eDataEntities[i];
DynamicObjectCollection collects = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total");
DynamicObjectCollection followcars = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_p");
Map<Long, DynamicObject > map = new HashMap<>();
Map<Long, String> map = new HashMap<>();
for (DynamicObject collect : collects) {
DynamicObject yemAccesmaterialTl = collect.getDynamicObject("yem_accesmaterial_tl");
if (yemAccesmaterialTl != null) {
long aLong = yemAccesmaterialTl.getLong("id");
String tlString = yemAccesmaterialTl.getString("number");
map.replace(aLong, tlString, map.get(aLong) + "," + tlString);
}
}
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 {
long aLong = yemAccesmaterial.getLong("id");
if (map.get(aLong) == 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"));
// 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"));
//
// }
// }
}
}
}
}