use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class DBAction method create.
@Action("create")
@Preset(conf = "", form = "", deft = { ":create" })
@Select(conf = "", form = "", mode = 2)
@Verify(conf = "", form = "")
@CommitSuccess
@Override
public void create(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "create", req);
Map rsp = ett.create(req);
rsp = getRspMap(helper, ett, "create", rsp);
String msg = getRspMsg(helper, ett, "create", 1);
helper.reply(msg, rsp);
}
use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class DBAction method update.
@Action("update")
@Preset(conf = "", form = "", deft = { ":update" })
@Verify(conf = "", form = "")
@CommitSuccess
@Override
public void update(ActionHelper helper) throws HongsException {
Model ett = getEntity(helper);
Map req = helper.getRequestData();
req = getReqMap(helper, ett, "update", req);
int num = ett.update(req);
String msg = getRspMsg(helper, ett, "update", num);
helper.reply(msg, num);
}
use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class DeptAction method doSave.
@Action("save")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
String id = model.set(rd);
rd = new HashMap();
rd.put("id", id);
rd.put("name", rd.get("name"));
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.save.dept.success");
helper.reply(ms, rd);
}
use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class UserAction method doDelete.
@Action("delete")
@CommitSuccess
public void doDelete(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
FetchCase fc = model.fetchCase();
fc.setOption("INCLUDE_REMOVED", Synt.declare(rd.get("include-removed"), false));
// 不能删除自己和超级管理员
Set rs = Synt.asSet(rd.get(model.table.primaryKey));
if (rs != null) {
if (rs.contains(helper.getSessibute(Cnst.UID_SES))) {
helper.fault("不能删除当前登录用户");
return;
}
if (rs.contains(Cnst.ADM_UID)) {
helper.fault("不能删除超级管理账号");
return;
}
}
int rn = model.delete(rd, fc);
CoreLocale ln = CoreLocale.getInstance().clone();
ln.load("master");
String ms = ln.translate("core.delete.user.success", Integer.toString(rn));
helper.reply(ms, rn);
}
use of app.hongs.action.anno.CommitSuccess in project HongsCORE by ihongs.
the class DataAction method redo.
@Action("revert/update")
@CommitSuccess
public void redo(ActionHelper helper) throws HongsException {
String id = helper.getParameter(Cnst.ID_KEY);
if (null == id || "".equals(id)) {
throw new HongsException(0x1100, "id required");
}
Data sr = (Data) getEntity(helper);
Map rd = helper.getRequestData();
sr.redo(id, rd);
helper.reply("");
}
Aggregations