Bladeren bron

增加SWConsts.debug,是否调试模式,调试模式缓存从数据库加载

4.0
郑根木 2 jaren geleden
bovenliggende
commit
aed2b1e379
1 gewijzigde bestanden met toevoegingen van 9 en 3 verwijderingen
  1. +9
    -3
      smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleSaveHandler.java

+ 9
- 3
smtweb-framework/bpm/src/main/java/cc/smtweb/system/bpm/web/engine/model/listcard/single/LCSingleSaveHandler.java Bestand weergeven

@@ -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<DefaultEntity> dao = DbEngine.getInstance().findDao(table.getName());


Laden…
Annuleren
Opslaan