Search in sources :

Example 1 with LocalService

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_");
    }
}
Also used : LocalService(cn.cerc.jbean.client.LocalService)

Example 2 with LocalService

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_");
    }
}
Also used : LocalService(cn.cerc.jbean.client.LocalService)

Example 3 with LocalService

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()));
}
Also used : LocalService(cn.cerc.jbean.client.LocalService)

Example 4 with LocalService

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);
    }
}
Also used : IMemcache(cn.cerc.jdb.cache.IMemcache) Gson(com.google.gson.Gson) Record(cn.cerc.jdb.core.Record) LocalService(cn.cerc.jbean.client.LocalService)

Example 5 with LocalService

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_");
}
Also used : Record(cn.cerc.jdb.core.Record) LocalService(cn.cerc.jbean.client.LocalService)

Aggregations

LocalService (cn.cerc.jbean.client.LocalService)19 Record (cn.cerc.jdb.core.Record)9 MemoryBuffer (cn.cerc.jbean.other.MemoryBuffer)4 DataSet (cn.cerc.jdb.core.DataSet)3 Gson (com.google.gson.Gson)2 AutoService (cn.cerc.jbean.client.AutoService)1 BookHandle (cn.cerc.jbean.core.BookHandle)1 Webfunc (cn.cerc.jbean.core.Webfunc)1 IForm (cn.cerc.jbean.form.IForm)1 UserNotFindException (cn.cerc.jbean.other.UserNotFindException)1 IMemcache (cn.cerc.jdb.cache.IMemcache)1 IHandle (cn.cerc.jdb.core.IHandle)1 JiguangPush (cn.cerc.jdb.jiguang.JiguangPush)1 SqlQuery (cn.cerc.jdb.mysql.SqlQuery)1 QueueQuery (cn.cerc.jdb.queue.QueueQuery)1 ClientDevice (cn.cerc.jmis.core.ClientDevice)1 AbstractForm (cn.cerc.jmis.form.AbstractForm)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 JSONObject (net.sf.json.JSONObject)1 Ignore (org.junit.Ignore)1