From aed2b1e379480c4218ddc77f027a19eb48dd0528 Mon Sep 17 00:00:00 2001 From: zhenggm Date: Thu, 18 Aug 2022 18:23:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0SWConsts.debug,=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E8=B0=83=E8=AF=95=E6=A8=A1=E5=BC=8F=EF=BC=8C=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E5=BC=8F=E7=BC=93=E5=AD=98=E4=BB=8E=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/model/listcard/single/LCSingleSaveHandler.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleSaveHandler.java b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleSaveHandler.java index 5d8063f..b06620d 100644 --- a/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleSaveHandler.java +++ b/smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleSaveHandler.java @@ -52,7 +52,7 @@ public class LCSingleSaveHandler extends AbstractDynPageHandler { //对应的数据集定义 PageDataset pageDataSet = LCSingleHelper.findCardDataset(datasets); //读取待保存的bean - DefaultEntity bean = readBeanFromPage(pageDataSet, data.readMap("form")); + DefaultEntity bean = readBeanFromPage(pageDataSet, data); if (filter != null && bean.isNew()) {//有过滤条件,将关联的值设上 setLinkValue(pageDataSet, bean, f -> filter.get(f.name)); } @@ -74,7 +74,7 @@ public class LCSingleSaveHandler extends AbstractDynPageHandler { afterRollback(bean); } }); - return R.success(DynRetBean.createBean(bean.getData())); + return R.success(LCSingleHelper.buildRetData(pageDataSet.name, bean.getData())); } /** @@ -84,9 +84,15 @@ public class LCSingleSaveHandler extends AbstractDynPageHandler { * @param data * @return */ - protected DefaultEntity readBeanFromPage(PageDataset pageDataSet, SwMap data) { + protected DefaultEntity readBeanFromPage(PageDataset pageDataSet, SwMap pageData) { ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable); if (table == null) throw new BizException("没有找到待保存的表定义:" + pageDataSet.name); + + SwMap data = pageData.readMap(pageDataSet.name); + if (data == null) throw new BizException("没有找到待保存的表数据:" + pageDataSet.name); + data = data.readMap("form"); + if (data == null) throw new BizException("没有找到待保存的表数据:" + pageDataSet.name); + long id = data.readLong(table.getIdField()); EntityDao dao = DbEngine.getInstance().findDao(table.getName());