@@ -5,7 +5,7 @@ import cc.smtweb.framework.core.common.SwEnum; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
@@ -65,7 +65,7 @@ public class ModelProcSaveHandler extends DefaultSaveHandler<ModelProc> { | |||
throw new BizException("没有待保存的数据!"); | |||
} | |||
bean.setContent(data); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
EntityDao<ModelProc> dao = DbEngine.getInstance().findDao(tableName); | |||
@@ -2,23 +2,19 @@ package cc.smtweb.system.bpm.web.design.form; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwEnum; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.framework.core.mvc.service.DefaultSaveHandler; | |||
import cc.smtweb.framework.core.util.CommUtil; | |||
import cc.smtweb.framework.core.util.JsonUtil; | |||
import cc.smtweb.system.bpm.web.design.form.model.ModelFactory; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import java.util.Set; | |||
/** | |||
* Created by Akmm at 2022/5/9 17:05 | |||
@@ -81,7 +77,7 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { | |||
throw new BizException("没有待保存的数据!"); | |||
} | |||
bean.setDataset(ModelFormHelper.buildSaveDataset(data)); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
EntityDao<ModelForm> dao = DbEngine.getInstance().findDao(tableName); | |||
@@ -113,7 +109,7 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { | |||
throw new BizException("没有待保存的数据!"); | |||
} | |||
bean.setContent(ModelFormHelper.buildSaveModel(bean, data)); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
EntityDao<ModelForm> dao = DbEngine.getInstance().findDao(tableName); | |||
@@ -149,7 +145,7 @@ public class ModelFormSaveHandler extends DefaultSaveHandler<ModelForm> { | |||
//先构建一次,防止有错 | |||
String ret = ModelFormHelper.buildReqModel(bean); | |||
// ModelFormHelper.buildSaveModelByTmpl(bean, templateId); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
EntityDao<ModelForm> dao = DbEngine.getInstance().findDao(tableName); | |||
@@ -9,7 +9,7 @@ import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.EntityHelper; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
@@ -39,7 +39,7 @@ public class DynPageDelHandler extends AbstractDynPageHandler { | |||
checkBean(pageDataSet, id); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable); | |||
@@ -107,7 +107,7 @@ public class DynPageDelHandler extends AbstractDynPageHandler { | |||
info.ids.addAll(list); | |||
} | |||
} | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
for (RemovableInfo info : mapRemovableInfo.values()) { | |||
@@ -9,12 +9,11 @@ import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelIndex; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.framework.core.mvc.service.DefaultSaveHandler; | |||
import cc.smtweb.framework.core.mvc.service.TreeHelper; | |||
import cc.smtweb.framework.core.util.StringUtil; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
@@ -55,7 +54,7 @@ public class DynPageSaveHandler extends AbstractDynPageHandler { | |||
} | |||
checkBean(bean); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
saveBean(bean); | |||
@@ -108,7 +107,7 @@ public class DynPageSaveHandler extends AbstractDynPageHandler { | |||
} | |||
checkBean(bean); | |||
} | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
for (DefaultEntity bean : map.values()) { | |||
@@ -62,7 +62,7 @@ public class FlowProvider extends AbstractCompProvider { | |||
public List<Task> findBeforeTasks(String taskIds) { | |||
EntityDao<Task> bdao = DbEngine.getInstance().findDao(Task.class); | |||
List<Task> list = bdao.queryEx(" t," + EntityHelper.getSchemaTableName(TaskRel.ENTITY_NAME) + " r " + | |||
"where t.task_id=r.trl_src_task_id and r.trl_dst_task_id in (" + taskIds + ")"); | |||
"where t.tsk_id=r.trl_src_task_id and r.trl_dst_task_id in (" + taskIds + ")"); | |||
if (CommUtil.isEmpty(list)) return new ArrayList<>(); | |||
return list; | |||
} | |||
@@ -2,7 +2,9 @@ package cc.smtweb.system.bpm.web.engine.model.flow.listcard.single; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.mvc.service.SwListData; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler; | |||
@@ -10,11 +12,8 @@ import cc.smtweb.system.bpm.web.engine.dynPage.DynRetBean; | |||
import cc.smtweb.system.bpm.web.engine.flow.FlowHelper; | |||
import cc.smtweb.system.bpm.web.engine.flow.FlowInstance; | |||
import cc.smtweb.system.bpm.web.engine.flow.FlowListener; | |||
import cc.smtweb.system.bpm.web.engine.flow.entity.Task; | |||
import cc.smtweb.system.bpm.web.engine.model.listcard.single.LCSingleHelper; | |||
import java.util.List; | |||
/** | |||
* Created by Akmm at 2022-09-01 15:03 | |||
* 流程流转 | |||
@@ -54,7 +53,13 @@ public class FlowTransHandler<T extends DefaultEntity> extends AbstractDynPageHa | |||
public R submit() { | |||
load(); | |||
flowInstance.submit(params.readString("comment")); | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
flowInstance.submit(params.readString("comment")); | |||
} | |||
}); | |||
return R.success(buildRetData()); | |||
} | |||
@@ -6,7 +6,7 @@ import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.EntityHelper; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
@@ -31,7 +31,7 @@ public abstract class AbsDelHandler extends AbstractDynPageHandler { | |||
// | |||
checkBean(pageDataset, id); | |||
// | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
ModelTable table = ModelTableCache.getInstance().get(pageDataset.masterTable); | |||
@@ -8,7 +8,7 @@ import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelIndex; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
@@ -51,7 +51,7 @@ public abstract class AbsSaveHandler <T extends DefaultEntity> extends AbstractD | |||
} | |||
checkBean(bean); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
saveBean(bean); | |||
@@ -9,7 +9,7 @@ import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.EntityHelper; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.system.bpm.web.engine.model.listcard.abshandler.AbsDelHandler; | |||
@@ -64,7 +64,7 @@ public class LCMsDelHandler extends AbsDelHandler { | |||
// | |||
List<? extends DefaultEntity> delDetails = subDao.queryWhere(subForeignKey + " = ?", id); | |||
checkDetails(delDetails); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
subDao.batchDelete(delDetails); | |||
@@ -6,7 +6,7 @@ import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
@@ -71,7 +71,7 @@ public class LCMsSaveHandler extends AbsSaveHandler<DefaultEntity> { | |||
// | |||
checkBean(masterBean); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
saveBean(masterBean); | |||
@@ -3,24 +3,15 @@ package cc.smtweb.system.bpm.web.engine.model.listcard.single; | |||
import cc.smtweb.framework.core.cache.AbstractCache; | |||
import cc.smtweb.framework.core.cache.CacheManager; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwEnum; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.EntityHelper; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDataset; | |||
import cc.smtweb.system.bpm.web.design.form.define.PageDatasetFilter; | |||
import cc.smtweb.system.bpm.web.engine.dynPage.AbstractDynPageHandler; | |||
import org.apache.commons.lang3.StringUtils; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import java.util.Map; | |||
/** | |||
* Created by Akmm at 2022/4/21 17:53 | |||
@@ -40,7 +31,7 @@ public class LCSingleDelHandler extends AbstractDynPageHandler { | |||
checkBean(pageDataSet, id); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
ModelTable table = ModelTableCache.getInstance().get(pageDataSet.masterTable); | |||
@@ -9,7 +9,7 @@ import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelIndex; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
@@ -52,7 +52,7 @@ public class LCSingleSaveHandler<T extends DefaultEntity> extends AbstractDynPag | |||
} | |||
checkBean(bean); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
saveBean(bean); | |||
@@ -3,7 +3,7 @@ package cc.smtweb.system.bpm.web.sys.user.menuPlan; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.framework.core.mvc.service.AbstractHandler; | |||
import cc.smtweb.framework.core.mvc.service.SwListData; | |||
@@ -48,7 +48,7 @@ public class MenuPlanHandler { | |||
menuPlanContent.saveItem(menuPlanItem, parent_id); | |||
menuPlan.setContent(menuPlanContent.toContentStr()); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
DbEngine.getInstance().updateEntity(menuPlan, "smp_content"); | |||
@@ -79,7 +79,7 @@ public class MenuPlanHandler { | |||
menuPlanContent.delItem(id); | |||
menuPlan.setContent(menuPlanContent.toContentStr()); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
DbEngine.getInstance().updateEntity(menuPlan, "smp_content"); | |||
@@ -6,7 +6,7 @@ import cc.smtweb.framework.core.common.SwMap; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.framework.core.mvc.service.AbstractHandler; | |||
@@ -178,7 +178,7 @@ public class UserHandler { | |||
public R batchDelParty() { | |||
Set<Long> idList = params.readLongSet("ids"); | |||
Set<Long> roleIdList = UserRoleCache.getInstance().getByParty(idList); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
getUserPartyDao().deleteEntity(idList); | |||
@@ -198,7 +198,7 @@ public class UserHandler { | |||
long id = params.readLong("id"); | |||
Set<Long> partyIds = UserPartyCache.getInstance().getIdByUser(id); | |||
Set<Long> roleIds = UserRoleCache.getInstance().getByParty(partyIds); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
getUserDao().deleteEntity(id); | |||
@@ -224,7 +224,7 @@ public class UserHandler { | |||
userList.forEach(user -> { | |||
user.setPwd(LoginHelper.encodePwd(user.getId(), SwConsts.DEF_PWD)); | |||
}); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
DbEngine.getInstance().findDao(User.ENTITY_NAME).batchUpdateEntity(userList); | |||
@@ -2,8 +2,9 @@ package cc.smtweb.framework.core.db.jdbc; | |||
/** | |||
* Created by Akmm at 14-2-15 下午1:51 | |||
* 数据库事务操作方法类 | |||
* 数据库事务操作方法类,被废弃,用IDbWorker替代 | |||
*/ | |||
@Deprecated | |||
public abstract class AbsDbWorker implements IDbWorker { | |||
@Override | |||
public void doAfterDbCommit() {} | |||
@@ -5,11 +5,11 @@ package cc.smtweb.framework.core.db.jdbc; | |||
* 数据库事务操作方法类 | |||
*/ | |||
public interface IDbWorker { | |||
public void work(); | |||
default void work(){} | |||
//数据库提交完后的业务或缓存处理 | |||
public void doAfterDbCommit(); | |||
default void doAfterDbCommit(){} | |||
//数据库回滚后的业务或缓存处理 | |||
public void doAfterDbRollback(); | |||
default void doAfterDbRollback(){} | |||
} |
@@ -2,7 +2,7 @@ package cc.smtweb.framework.core.mvc.service; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import lombok.extern.slf4j.Slf4j; | |||
/** | |||
@@ -17,7 +17,7 @@ public abstract class AbstractDelHandler extends AbstractHandler{ | |||
id = readId(); | |||
checkValid(); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
delDb(); | |||
@@ -25,13 +25,11 @@ public abstract class AbstractDelHandler extends AbstractHandler{ | |||
@Override | |||
public void doAfterDbCommit() { | |||
super.doAfterDbCommit(); | |||
saveSuccess(); | |||
} | |||
@Override | |||
public void doAfterDbRollback() { | |||
super.doAfterDbRollback(); | |||
saveFailed(); | |||
} | |||
}); | |||
@@ -2,7 +2,7 @@ package cc.smtweb.framework.core.mvc.service; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import lombok.extern.slf4j.Slf4j; | |||
/** | |||
@@ -29,7 +29,7 @@ public abstract class AbstractSaveHandler<T> extends AbstractHandler { | |||
setNewId(); | |||
} | |||
checkValid(); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work(){ | |||
saveDb(); | |||
@@ -4,13 +4,12 @@ import cc.smtweb.framework.core.cache.AbstractCache; | |||
import cc.smtweb.framework.core.cache.CacheManager; | |||
import cc.smtweb.framework.core.common.R; | |||
import cc.smtweb.framework.core.common.SwEnum; | |||
import cc.smtweb.framework.core.db.jdbc.IDbWorker; | |||
import cc.smtweb.framework.core.exception.BizException; | |||
import cc.smtweb.framework.core.exception.SwException; | |||
import cc.smtweb.framework.core.db.DbEngine; | |||
import cc.smtweb.framework.core.db.EntityDao; | |||
import cc.smtweb.framework.core.db.cache.ModelTableCache; | |||
import cc.smtweb.framework.core.db.impl.DefaultEntity; | |||
import cc.smtweb.framework.core.db.jdbc.AbsDbWorker; | |||
import cc.smtweb.framework.core.db.vo.ModelField; | |||
import cc.smtweb.framework.core.db.vo.ModelIndex; | |||
import cc.smtweb.framework.core.db.vo.ModelTable; | |||
@@ -46,7 +45,7 @@ public class DefaultSaveHandler<T extends DefaultEntity> extends AbstractHandler | |||
readFromPage(); | |||
if (bean.getEntityId() <= 0L) bean.setEntityId(DbEngine.getInstance().nextId()); | |||
checkValid(); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work(){ | |||
saveDb(); | |||
@@ -159,7 +158,7 @@ public class DefaultSaveHandler<T extends DefaultEntity> extends AbstractHandler | |||
ModelField fieldParentId = table.findFieldByType(SwEnum.FieldType.PARENT_ID.value); | |||
bean.put(fieldParentId.getName(), parentId); | |||
DbEngine.getInstance().doTrans(new AbsDbWorker() { | |||
DbEngine.getInstance().doTrans(new IDbWorker() { | |||
@Override | |||
public void work() { | |||
listTreeBean = TreeHelper.getTreeHelper(tableName).resetTreeLevel(bean); | |||