|
@@ -1,11 +1,8 @@ |
|
|
package cc.smtweb.framework.core.mvc.service; |
|
|
package cc.smtweb.framework.core.mvc.service; |
|
|
|
|
|
|
|
|
import cc.smtweb.framework.core.R; |
|
|
import cc.smtweb.framework.core.R; |
|
|
import cc.smtweb.framework.core.SwException; |
|
|
|
|
|
import cc.smtweb.framework.core.SwMap; |
|
|
|
|
|
import cc.smtweb.framework.core.db.DbEngine; |
|
|
import cc.smtweb.framework.core.db.DbEngine; |
|
|
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; |
|
|
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; |
|
|
import cc.smtweb.framework.core.session.UserSession; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@@ -29,6 +26,9 @@ public abstract class AbstractSaveHandler<T> extends AbstractHandler { |
|
|
bean = loadComp(id); |
|
|
bean = loadComp(id); |
|
|
} |
|
|
} |
|
|
readFromPage(); |
|
|
readFromPage(); |
|
|
|
|
|
if (isNew) { |
|
|
|
|
|
setNewId(); |
|
|
|
|
|
} |
|
|
checkValid(); |
|
|
checkValid(); |
|
|
DbEngine.getInstance().doTrans(new AbsDbWorker() { |
|
|
DbEngine.getInstance().doTrans(new AbsDbWorker() { |
|
|
@Override |
|
|
@Override |
|
@@ -57,6 +57,7 @@ public abstract class AbstractSaveHandler<T> extends AbstractHandler { |
|
|
protected long readId() { |
|
|
protected long readId() { |
|
|
return params.readLong("id", 0L); |
|
|
return params.readLong("id", 0L); |
|
|
} |
|
|
} |
|
|
|
|
|
protected abstract void setNewId(); |
|
|
|
|
|
|
|
|
//从页面读取数据 |
|
|
//从页面读取数据 |
|
|
protected abstract void readFromPage(); |
|
|
protected abstract void readFromPage(); |
|
|