use of cn.cerc.jbean.client.LocalService in project summer-bean by cn-cerc.
the class BookOptions method getOption2.
public static String getOption2(IHandle handle, String ACode, String def) {
try (MemoryBuffer buff = new MemoryBuffer(BufferType.getVineOptions, handle.getCorpNo(), ACode)) {
if (buff.isNull() || buff.getString("Value_").equals("")) {
log.info("reset buffer.");
LocalService ser = new LocalService(handle, "SvrBookOption");
if (ser.exec("Code_", ACode) && !ser.getDataOut().eof())
buff.setField("Value_", ser.getDataOut().getString("Value_"));
else
buff.setField("Value_", def);
}
return buff.getString("Value_");
}
}
use of cn.cerc.jbean.client.LocalService in project summer-bean by cn-cerc.
the class UserOptions method GetUserOption.
private static String GetUserOption(IHandle sess, String ACode, String ADefault) {
try (MemoryBuffer buff = new MemoryBuffer(BufferType.getUserOption, sess.getUserCode(), ACode)) {
if (buff.isNull()) {
String Result = ADefault;
LocalService ser = new LocalService(sess, "SvrUserOption");
if (ser.exec("Code_", ACode) && !ser.getDataOut().eof()) {
Result = ser.getDataOut().getString("Value_");
}
buff.setField("Value_", Result);
}
return buff.getString("Value_");
}
}
use of cn.cerc.jbean.client.LocalService in project summer-mis by cn-cerc.
the class ProcessService method updateMessage.
/**
* 保存到数据库
*/
private void updateMessage(AsyncService task, String msgId, String subject) {
task.setProcessTime(TDateTime.Now().toString());
LocalService svr = new LocalService(this, "SvrUserMessages.updateAsyncService");
if (!svr.exec("msgId", msgId, "content", task.toString(), "process", task.getProcess()))
throw new RuntimeException("更新任务队列进度异常:" + svr.getMessage());
log.debug(task.getService() + ":" + subject + ":" + AsyncService.getProcessTitle(task.getProcess()));
}
use of cn.cerc.jbean.client.LocalService in project summer-mis by cn-cerc.
the class MemoryBookInfo method get.
public static BookInfoRecord get(IHandle handle, String corpNo) {
IMemcache buff = Application.getMemcache();
String tmp = (String) buff.get(getBuffKey(corpNo));
if (tmp == null || "".equals(tmp)) {
LocalService svr = new LocalService(handle, "SvrBookInfo.getRecord");
if (!svr.exec("corpNo", corpNo))
return null;
BookInfoRecord result = new BookInfoRecord();
Record ds = svr.getDataOut().getHead();
result.setCode(ds.getString("corpNo"));
result.setShortName(ds.getString("shortName"));
result.setName(ds.getString("name"));
result.setAddress(ds.getString("address"));
result.setTel(ds.getString("tel"));
result.setManagerPhone(ds.getString("managerPhone"));
result.setStartHost(ds.getString("host"));
result.setContact(ds.getString("contact"));
result.setAuthentication(ds.getBoolean("authentication"));
result.setStatus(ds.getInt("status"));
result.setCorpType(ds.getInt("type"));
Gson gson = new Gson();
buff.set(getBuffKey(corpNo), gson.toJson(result));
return result;
} else {
Gson gson = new Gson();
return gson.fromJson(tmp, BookInfoRecord.class);
}
}
use of cn.cerc.jbean.client.LocalService in project summer-mis by cn-cerc.
the class AppLoginPage method getAccountFromTel.
/**
* @param handle
* 环境变量
* @param 电话号码
* @return 根据电话号码返回用户帐号,用于普及版登入
* @throws ServletException
* 异常
* @throws IOException
* 异常
*/
private String getAccountFromTel(IHandle handle, String tel) throws ServletException, IOException {
LocalService app = new LocalService(handle);
app.setService("SvrUserLogin.getUserCodeByMobile");
app.getDataIn().getHead().setField("UserCode_", tel);
if (!app.exec()) {
Record headOut = app.getDataOut().getHead();
throw new RuntimeException(headOut.getString("Msg_"));
} else
return app.getDataOut().getHead().getString("UserCode_");
}
Aggregations