From 1194ed3c99d6f3f8d88c4483084e5b6529fca5fe Mon Sep 17 00:00:00 2001 From: zzs Date: Thu, 5 Dec 2024 15:14:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=87=BA=E5=8F=A3=E6=8A=A5=E5=85=B3?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E5=AD=98=E5=89=8D=E4=B8=8D=E8=83=BD=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8A=A5=E5=85=B3=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../es/declaredocx/form/DeclareDocxEdit.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/main/java/com/yem/wm/es/declaredocx/form/DeclareDocxEdit.java b/src/main/java/com/yem/wm/es/declaredocx/form/DeclareDocxEdit.java index 95e9fb0c..0acc7dad 100644 --- a/src/main/java/com/yem/wm/es/declaredocx/form/DeclareDocxEdit.java +++ b/src/main/java/com/yem/wm/es/declaredocx/form/DeclareDocxEdit.java @@ -334,6 +334,10 @@ public class DeclareDocxEdit extends AbstractBillPlugIn implements BeforeF7Selec String operateKey = e.getOperateKey(); // if (StringUtils.isNotEmpty(operateKey) && isSuccess) { if (operateKey.equals("cocudeclaration_s") || operateKey.equals("cocudeclaration")) { + if (!validatorIsSaved(model)) { + view.showErrorNotification("请保存后再进行操作!"); + return; + } model.deleteEntryData("yem_es_declare_ec"); model.deleteEntryData("yem_es_declare_ecd"); //报关合并 @@ -670,6 +674,10 @@ public class DeclareDocxEdit extends AbstractBillPlugIn implements BeforeF7Selec } if ("mergedata".equals(operateKey)) { + if (!validatorIsSaved(model)) { + view.showErrorNotification("请保存后再进行操作!"); + return; + } mergeDeclareData(); } @@ -735,6 +743,23 @@ public class DeclareDocxEdit extends AbstractBillPlugIn implements BeforeF7Selec } } + /** + * 是否保存,没保存则提示 + * @param model + * @return + */ + private boolean validatorIsSaved(IDataModel model) { + DynamicObject dataEntity = model.getDataEntity(true); + DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("yem_es_materialinfo"); + for (DynamicObject d : collection) { + long id = d.getLong("id"); + if (id <= 0) { + return false; + } + } + return true; + } + /** * 根据合并规则将商品明细的数据生成到报关商品页签 */