use of cn.cerc.jdb.core.Record in project summer-mis by cn-cerc.
the class SvrUserLogin method getMachInfo.
// 获取用户的移动设备信息
public boolean getMachInfo() throws DataValidateException {
Record headIn = getDataIn().getHead();
String userCode = headIn.getString("UserCode_");
DataValidateException.stopRun("用户帐号不允许为空", "".equals(userCode));
String corpNo = headIn.getString("CorpNo_");
DataValidateException.stopRun("用户帐套不允许为空", "".equals(corpNo));
SqlQuery cdsTmp = new SqlQuery(this);
cdsTmp.add("select * from %s", SystemTable.get(SystemTable.getDeviceVerify));
cdsTmp.add("where CorpNo_='%s'and UserCode_='%s'", corpNo, userCode);
/*
* FIXME MachineType_代表设备类型,6-iOS、7-Android,用于极光推送 JPushRecord
*
* 黄荣君 2017-06-19
*/
cdsTmp.add("and Used_=1 and MachineType_ in (6,7)");
cdsTmp.add("and ifnull(MachineCode_,'')<>''");
cdsTmp.open();
getDataOut().appendDataSet(cdsTmp);
return true;
}
use of cn.cerc.jdb.core.Record in project summer-mis by cn-cerc.
the class SvrUserMessages method readAsyncService.
/**
* @return 读取指定的消息记录
*/
public boolean readAsyncService() {
String msgId = getDataIn().getHead().getString("msgId");
SqlQuery ds = new SqlQuery(this);
ds.add("select * from %s", SystemTable.get(SystemTable.getUserMessages));
ds.add("where Level_=%s", MessageLevel.Service.ordinal());
ds.add("and Process_=%s", MessageProcess.wait.ordinal());
ds.add("and UID_='%s'", msgId);
ds.open();
if (// 此任务可能被其它主机抢占
ds.eof())
return false;
Record headOut = getDataOut().getHead();
headOut.setField("corpNo", ds.getString("CorpNo_"));
headOut.setField("userCode", ds.getString("UserCode_"));
headOut.setField("subject", ds.getString("Subject_"));
headOut.setField("content", ds.getString("Content_"));
return true;
}
use of cn.cerc.jdb.core.Record in project summer-mis by cn-cerc.
the class RangeField method output.
@Override
public void output(HtmlWriter html) {
Record record = dataSource != null ? dataSource.getDataSet().getCurrent() : null;
if (this.hidden) {
html.print("<input");
html.print(" type=\"hidden\"");
html.print(" name=\"%s\"", this.getId());
html.print(" id=\"%s\"", this.getId());
String value = this.getText(record);
if (value != null)
html.print(" value=\"%s\"", value);
html.println("/>");
} else {
html.println("<label for=\"%s\">%s</label>", this.getId(), this.getName() + ":");
AbstractField child = null;
for (Component component : this.getComponents()) {
if (component instanceof AbstractField) {
if (child != null)
html.print("-");
child = (AbstractField) component;
String val = child.getCSSClass_phone();
child.setCSSClass_phone("price");
child.outputInput(html, record);
child.setCSSClass_phone(val);
}
}
if (this.dialog != null) {
html.print("<span>");
html.print("<a href=\"javascript:%s('%s')\">", this.dialog, this.getId());
html.print("<img src=\"images/select-pic.png\">");
html.print("</a>");
html.print("</span>");
} else {
html.print("<span></span>");
}
}
}
use of cn.cerc.jdb.core.Record in project summer-mis by cn-cerc.
the class RemoteServiceTest method test.
@Test
@Ignore
public void test() {
RemoteService app = new RemoteService();
// app.setHost("r1.knowall.cn");
app.setService("SvrUserLogin.check");
DataSet datain = app.getDataIn();
Record head = datain.getHead();
head.setField("Account_", "admin");
head.setField("Password_", "123456");
head.setField("MachineID_", "webclient");
boolean result = app.exec();
assertTrue(app.getMessage(), result);
}
use of cn.cerc.jdb.core.Record in project summer-mis by cn-cerc.
the class SvrUserLoginTest method testCheck2.
@Test
@Ignore
public void testCheck2() throws SecurityCheckException {
StubHandle handle = new StubHandle();
String userCode = handle.getUserCode();
SvrUserLogin app = new SvrUserLogin();
app.init(handle);
Record headIn = app.getDataIn().getHead();
headIn.setField("Account_", userCode);
boolean ok = app.Check();
assertEquals(app.getMessage(), "您的登录密码错误,禁止登录!");
assertThat(app.getDataOut().getJSON(), is("{\"head\":{\"errorNo\":0}}"));
assertTrue(!ok);
}
Aggregations