fix:出口报关,保存前不能进行报关合并

This commit is contained in:
zzs 2024-12-05 15:14:35 +08:00 committed by ljw
parent 883fc64c67
commit 1194ed3c99

View File

@ -334,6 +334,10 @@ public class DeclareDocxEdit extends AbstractBillPlugIn implements BeforeF7Selec
String operateKey = e.getOperateKey(); String operateKey = e.getOperateKey();
// if (StringUtils.isNotEmpty(operateKey) && isSuccess) { // if (StringUtils.isNotEmpty(operateKey) && isSuccess) {
if (operateKey.equals("cocudeclaration_s") || operateKey.equals("cocudeclaration")) { 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_ec");
model.deleteEntryData("yem_es_declare_ecd"); model.deleteEntryData("yem_es_declare_ecd");
//报关合并 //报关合并
@ -670,6 +674,10 @@ public class DeclareDocxEdit extends AbstractBillPlugIn implements BeforeF7Selec
} }
if ("mergedata".equals(operateKey)) { if ("mergedata".equals(operateKey)) {
if (!validatorIsSaved(model)) {
view.showErrorNotification("请保存后再进行操作!");
return;
}
mergeDeclareData(); 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;
}
/** /**
* 根据合并规则将商品明细的数据生成到报关商品页签 * 根据合并规则将商品明细的数据生成到报关商品页签
*/ */