|
@@ -61,11 +61,12 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { |
|
|
public R saveModel() { |
|
|
public R saveModel() { |
|
|
long id = params.readLong("id"); |
|
|
long id = params.readLong("id"); |
|
|
String data = params.readString("data"); |
|
|
String data = params.readString("data"); |
|
|
ModelForm form = loadComp(id); |
|
|
|
|
|
|
|
|
bean = loadComp(id); |
|
|
if (StringUtils.isEmpty(data)) { |
|
|
if (StringUtils.isEmpty(data)) { |
|
|
throw new SwException("没有待保存的数据!"); |
|
|
throw new SwException("没有待保存的数据!"); |
|
|
} |
|
|
} |
|
|
form.setContent(ModelFormHelper.buildSaveModel(form)); |
|
|
|
|
|
|
|
|
bean.setContent(data); |
|
|
|
|
|
bean.setContent(ModelFormHelper.buildSaveModel(bean)); |
|
|
DbEngine.getInstance().doTrans(new AbsDbWorker() { |
|
|
DbEngine.getInstance().doTrans(new AbsDbWorker() { |
|
|
@Override |
|
|
@Override |
|
|
public void work() { |
|
|
public void work() { |
|
@@ -74,7 +75,7 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { |
|
|
ModelTable table = ModelTableCache.getInstance().getByName(tableName); |
|
|
ModelTable table = ModelTableCache.getInstance().getByName(tableName); |
|
|
ModelField field = table.findFieldByType(SwEnum.FieldType.UPDATE_USER.value); |
|
|
ModelField field = table.findFieldByType(SwEnum.FieldType.UPDATE_USER.value); |
|
|
if (field != null) bean.put(field.getName(), us.getUserId()); |
|
|
if (field != null) bean.put(field.getName(), us.getUserId()); |
|
|
dao.updateEntity(form, "mf_content"); |
|
|
|
|
|
|
|
|
dao.updateEntity(bean, "mf_content"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|