use of io.github.ihongs.action.anno.Action in project HongsCORE by ihongs.
the class UnitAction method isUnique.
@Action("unique")
public void isUnique(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
boolean un = model.unique(rd);
helper.reply(null, un ? 1 : 0);
}
use of io.github.ihongs.action.anno.Action in project HongsCORE by ihongs.
the class UnitAction method doSave.
@Action("save")
@Verify(conf = "matrix", form = "unit")
@CommitSuccess
public void doSave(ActionHelper helper) throws HongsException {
Map rd = helper.getRequestData();
String id = model.set(rd);
CoreLocale lang = CoreLocale.getInstance().clone();
lang.load("matrix");
String ms = lang.translate("core.save.unit.success");
helper.reply(ms, id);
}
use of io.github.ihongs.action.anno.Action in project HongsCORE by ihongs.
the class SearchAction method search.
@Action("search")
@Preset(conf = "", form = "")
@Select(conf = "", form = "")
@Override
public void search(ActionHelper helper) throws HongsException {
/**
* 有指定查询条件则按匹配度排序
*/
Map rd = helper.getRequestData();
Object wd = rd.get(Cnst.WD_KEY);
if (wd != null && !"".equals(wd)) {
Set xb = Synt.toTerms(rd.get(Cnst.OB_KEY));
List ob;
if (xb == null) {
ob = new ArrayList(1);
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
} else if (!xb.contains("-") && !xb.contains("*")) {
ob = new ArrayList(xb);
rd.put(Cnst.OB_KEY, ob);
ob.add(0, "-");
}
}
super.search(helper);
}
use of io.github.ihongs.action.anno.Action in project HongsCORE by ihongs.
the class SearchAction method acount.
@Action("acount")
@Preset(conf = "", form = "")
@Titles(conf = "", form = "")
public void acount(ActionHelper helper) throws HongsException {
SearchEntity sr = (SearchEntity) getEntity(helper);
StatisHelper sh = new StatisHelper(sr);
Map rd = helper.getRequestData();
rd = getReqMap(helper, sr, "acount", rd);
// 检查参数
acheck(sr, rd, 1);
Map xd = sh.acount(rd);
Map sd = Synt.mapOf("enfo", xd);
sd = getRspMap(helper, sr, "acount", sd);
helper.reply(sd);
}
use of io.github.ihongs.action.anno.Action in project HongsCORE by ihongs.
the class SearchAction method amount.
@Action("amount")
@Preset(conf = "", form = "")
@Titles(conf = "", form = "")
public void amount(ActionHelper helper) throws HongsException {
SearchEntity sr = (SearchEntity) getEntity(helper);
StatisHelper sh = new StatisHelper(sr);
Map rd = helper.getRequestData();
rd = getReqMap(helper, sr, "amount", rd);
// 检查参数
acheck(sr, rd, 2);
Map xd = sh.amount(rd);
Map sd = Synt.mapOf("enfo", xd);
sd = getRspMap(helper, sr, "amount", sd);
helper.reply(sd);
}
Aggregations