|
|
@@ -41,11 +41,16 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void insertBean(EntityDao<ModelForm> dao) { |
|
|
|
super.insertBean(dao); |
|
|
|
listFormChild = new ArrayList<>(); |
|
|
|
ModelFactory.getInstance().saveForm(bean, listFormChild); |
|
|
|
super.insertBean(dao); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void checkValid() { |
|
|
|
super.checkValid(); |
|
|
|
DbEngine.getInstance().findDao(ModelForm.class).checkUnique(bean, "mf_prj_id", "mf_name"); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void saveSuccess() { |
|
|
@@ -132,15 +137,15 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { |
|
|
|
} |
|
|
|
|
|
|
|
public R saveModelByTmpl() { |
|
|
|
long id = params.readLong("pageId"); |
|
|
|
String templateId = params.readString("templateId"); |
|
|
|
String id = params.readString("pageId"); |
|
|
|
String data = params.readString("data"); |
|
|
|
bean = loadComp(id); |
|
|
|
bean = ModelFormHelper.getFromCache(id); |
|
|
|
if (StringUtils.isEmpty(data)) { |
|
|
|
throw new BizException("没有待保存的数据!"); |
|
|
|
} |
|
|
|
bean.setTmpl(data); |
|
|
|
ModelFormHelper.buildSaveModelByTmpl(bean, templateId); |
|
|
|
ModelFactory.getInstance().buildSaveModel(bean); |
|
|
|
// ModelFormHelper.buildSaveModelByTmpl(bean, templateId); |
|
|
|
DbEngine.getInstance().doTrans(new AbsDbWorker() { |
|
|
|
@Override |
|
|
|
public void work() { |
|
|
|