diff --git a/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit.java b/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit.java index 55253e09..c50d55cb 100644 --- a/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit.java +++ b/src/main/java/com/yem/wm/es/storagetrans/form/StorageTransEdit.java @@ -235,11 +235,13 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele String yemProducts = loadSingle.getString("yem_products.number"); String aLong = loadSingle.getString("yem_productmodel.yem_products.number"); BigDecimal yemQty = loadSingle.getBigDecimal("yem_qty"); - if (map.get(yemContractnumbersM+yemShipmentnumbersM+yemProducts+aLong) != null) { - BigDecimal bigDecimal = map.get(yemContractnumbersM+yemShipmentnumbersM+yemProducts+aLong); - map.put(yemContractnumbersM+yemShipmentnumbersM+yemProducts+aLong, bigDecimal.add(yemQty)); - } else { - map.put(yemContractnumbersM+yemShipmentnumbersM+yemProducts+aLong, yemQty); + BigDecimal yemSinglepartgiftmat = loadSingle.getBigDecimal("yem_singlepartgiftmat"); + if (yemSinglepartgiftmat.compareTo(BigDecimal.ZERO) != 0) { + if (map.get(yemContractnumbersM + yemShipmentnumbersM + yemProducts + aLong) != null) { + map.compute(yemContractnumbersM + yemShipmentnumbersM + yemProducts + aLong, (k, bigDecimal) -> bigDecimal.add(yemQty)); + } else { + map.put(yemContractnumbersM + yemShipmentnumbersM + yemProducts + aLong, yemQty); + } } } DynamicObjectCollection yemEsSalesorderL = this.getModel().getEntryEntity("yem_es_salesorder_l"); @@ -1285,9 +1287,9 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele String name = dataEntity.getDataEntityType().getName(); DynamicObjectCollection materialinfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo"); BigDecimal sum = BigDecimal.ZERO; - boolean allonPush = true; + BigDecimal allonPush = BigDecimal.ZERO; +// boolean allonPush = true; for (DynamicObject dynamicObject : materialinfo) { - BigDecimal adstamount = dynamicObject.getBigDecimal("yem_adstamount"); // 销售出库金额-提交 BigDecimal saamtpriceclause; if ("yem_es_declaredocx".equals(name)) { @@ -1299,13 +1301,18 @@ public class StorageTransEdit extends AbstractBillPlugIn implements BeforeF7Sele } BigDecimal amt = adstamount.subtract(saamtpriceclause); - if (amt.compareTo(BigDecimal.ZERO) != 0) { - allonPush = false; + BigDecimal yemExportmat = dynamicObject.getBigDecimal("yem_exportmat"); + if (yemExportmat.compareTo(BigDecimal.ZERO) > 0) { + allonPush = allonPush.add(yemExportmat); } sum = sum.add(amt); dynamicObject.set("yem_exportmat", amt); } dataEntity.set("yem_exportmatsum", sum); - dataEntity.set("yem_allonpush", allonPush); + if (allonPush.compareTo(BigDecimal.ZERO) == 0) { + dataEntity.set("yem_allonpush", true); + }else { + dataEntity.set("yem_allonpush", false); + } } }