From 441c44ad7a3b44b30689f62a24c33b0b5f8fc5c8 Mon Sep 17 00:00:00 2001 From: 25655 <2565550274@qq.com> Date: Thu, 13 Feb 2025 10:07:46 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=201.=E6=96=B0=E5=A2=9E=E5=A4=96?= =?UTF-8?q?=E9=94=80=E5=90=88=E5=90=8C=E6=8F=90=E4=BA=A4=E6=99=93=E7=87=95?= =?UTF-8?q?=202.=E5=A4=96=E9=94=80=E5=90=88=E5=90=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E8=B5=A0=E5=93=81=E5=80=BC=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit a02ae1327042a1bd41345de052f1e9319cd3d6c6) --- .../wm/es/salesorder/from/SalesOrderEdit.java | 17 +++++++++++++++++ .../wm/es/salesorder/from/SalesOrderZJEdit.java | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderEdit.java b/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderEdit.java index e7de39dd..dc465860 100644 --- a/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderEdit.java +++ b/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderEdit.java @@ -1981,6 +1981,23 @@ public class SalesOrderEdit extends AbstractBillPlugIn implements Plugin, Before if ("submit".equals(operateKey)) { setNewpPrice(dataEntity, view); checkGiftsGivenNumber(dataEntity, e); + DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("yem_es_salesorder_zp"); + Map map = new HashMap<>(); + for (DynamicObject dynamicObject : collection) { + DynamicObject yemGiveproactype = dynamicObject.getDynamicObject("yem_giveproactype"); + if (yemGiveproactype != null) { + long aLong = yemGiveproactype.getLong("id"); + BigDecimal yemSingleamt = dynamicObject.getBigDecimal("yem_singleamt"); + if (map.get(aLong)!=null){ + if (map.get(aLong).compareTo(yemSingleamt)!=0){ + ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("checkGiftsGivenNumber", this); + this.getView().showConfirm("赠送配件分录同一机型存在多个单台配件金额,请检查后在进行提交!!!", MessageBoxOptions.OKCancel, confirmCallBackListener); + } + }else { + map.put(aLong,yemSingleamt); + } + } + } } if ("save".equals(operateKey)) { diff --git a/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderZJEdit.java b/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderZJEdit.java index 178061d9..3006e899 100644 --- a/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderZJEdit.java +++ b/src/main/java/com/yem/wm/es/salesorder/from/SalesOrderZJEdit.java @@ -619,10 +619,12 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo IDataModel model = this.getModel(); DynamicObject dynamicObject = model.getDataEntity(true); DynamicObject giveproactype = (DynamicObject) model.getValue("yem_giveproactype", rowIndex); + BigDecimal yemSingleamt = (BigDecimal) model.getValue("yem_singleamt", rowIndex); if (giveproactype == null) return; DynamicObjectCollection materialinfo = dynamicObject.getDynamicObjectCollection("yem_es_materialinfo"); BigDecimal qty = BigDecimal.ZERO; for (DynamicObject object : materialinfo) { + BigDecimal yemSinglepartgiftmat = object.getBigDecimal("yem_singlepartgiftmat"); String businesssort = object.getString("yem_businesssort"); boolean ifgift = object.getBoolean("yem_ifgift"); if ("Z".equals(businesssort) && !ifgift) { @@ -630,7 +632,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo if (productmodel == null) continue; productmodel = BusinessDataServiceHelper.loadSingle(productmodel.getPkValue(), productmodel.getDynamicObjectType().getName()); DynamicObject products = productmodel.getDynamicObject("yem_products"); - if (products != null && products.getLong("id") == giveproactype.getLong("id")) { + if (products != null && products.getLong("id") == giveproactype.getLong("id")&&yemSingleamt.compareTo(yemSinglepartgiftmat)==0) { qty = qty.add(object.getBigDecimal("yem_qty")); } }