Here are the examples of the java api com.x.base.core.project.logger.Logger.error() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2719 Examples
19
Source : PassExpired.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private void executeWithLogException(Task task) {
try {
this.execute(task);
} catch (Exception e) {
logger.error(e);
}
}
19
Source : WeLinkConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 是否需要把钉钉消息转成markdown格式消息
* 根据是否配置了钉钉工作链接、是否是工作消息(目前只支持工作消息)
* @param messageType 消息类型 判断是否是工作消息
* @return
*/
private boolean needTransferLink(String messageType) {
try {
String workUrl = Config.weLink().getWorkUrl();
if (workUrl != null && !"".equals(workUrl) && workMessageTypeList().contains(messageType)) {
return true;
}
} catch (Exception e) {
logger.error(e);
}
return false;
}
19
Source : QiyeweixinConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 获取workid
* @param messageBody
* @return
*/
private String getWorkIdFromBody(String messageBody) {
try {
JsonObject object = new JsonParser().parse(messageBody).getAsJsonObject();
return object.get("work").getreplacedtring();
// if (messageType.startsWith("task_")) {
// JsonObject object =new JsonParser().parse(messageBody).getAsJsonObject();
// return object.get("work").getreplacedtring();
// }else if (messageType.startsWith("taskCompleted_")) {
// JsonObject object =new JsonParser().parse(messageBody).getAsJsonObject();
// String work = object.get("work").getreplacedtring();
// String workCompleted = object.get("workCompleted").getreplacedtring();
// if (workCompleted != null && !"".equals(workCompleted)) {
// return workCompleted;
// }else {
// return work;
// }
// }else if (messageType.startsWith("read_")) {
// JsonObject object =new JsonParser().parse(messageBody).getAsJsonObject();
// return object.get("work").getreplacedtring();
// }else if (messageType.startsWith("readCompleted_")) {
// JsonObject object =new JsonParser().parse(messageBody).getAsJsonObject();
// String work = object.get("work").getreplacedtring();
// String workCompleted = object.get("workCompleted").getreplacedtring();
// if (workCompleted != null && !"".equals(workCompleted)) {
// return workCompleted;
// }else {
// return work;
// }
// }else if (messageType.startsWith("review_")) {
// JsonObject object =new JsonParser().parse(messageBody).getAsJsonObject();
// return object.get("work").getreplacedtring();
// }
} catch (Exception e) {
logger.error(e);
}
return "";
}
19
Source : ThreadFactory.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public String aliveLocal(String name) {
try {
return find(name).isPresent() ? Config.node() : null;
} catch (Exception e) {
logger.error(e);
}
return null;
}
19
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void notify(Clreplaced<?> clz) throws Exception {
try {
if (null != cache) {
cache.notify(clz, new ArrayList<Object>());
}
} catch (Exception e) {
logger.error(e);
}
}
19
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void notify(Clreplaced<?> clz, Object... objects) throws Exception {
try {
if (null != cache) {
cache.notify(clz, ListTools.toList(objects));
}
} catch (Exception e) {
logger.error(e);
}
}
19
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void shutdown() {
try {
if (null != cache) {
cache.shutdown();
}
} catch (Exception e) {
logger.error(e);
}
}
19
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void notify(Clreplaced<?> clz, List<Object> keys) {
try {
if (null != cache) {
cache.notify(clz, keys);
}
} catch (Exception e) {
logger.error(e);
}
}
18
Source : ExtractTextHelper.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static String word(byte[] bytes) {
try (ByteArrayInputStream in = new ByteArrayInputStream(bytes)) {
return tikaInstance().parseToString(in);
} catch (Exception e) {
logger.error(e);
}
return null;
}
18
Source : ExtractTextHelper.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static String excel(byte[] bytes) {
try (ByteArrayInputStream in = new ByteArrayInputStream(bytes)) {
return tikaInstance().parseToString(in);
} catch (Exception e) {
logger.error(e);
}
return null;
}
18
Source : BaseAction.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
protected CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
return CompletableFuture.supplyAsync(() -> {
Boolean value = false;
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
Business business = new Business(emc);
value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag, new ExceptionEnreplacedyNotExist(flag));
} catch (Exception e) {
logger.error(e);
}
return value;
});
}
18
Source : ActionListWithWorkOrWorkCompletedPaging.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Boolean> checkControlFuture(EffectivePerson effectivePerson, String flag) {
return CompletableFuture.supplyAsync(() -> {
Boolean value = false;
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
Business business = new Business(emc);
value = business.readableWithWorkOrWorkCompleted(effectivePerson, flag, new ExceptionEnreplacedyNotExist(flag));
} catch (Exception e) {
logger.error(e);
}
return value;
});
}
18
Source : WeLinkConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 生成单点登录和打开工作的地址
* @param messageBody
* @return
*/
private String getDingdingOpenWorkUrl(String messageBody) {
try {
String work = getWorkIdFromBody(messageBody);
String o2oaUrl = Config.weLink().getWorkUrl();
if (work == null || "".equals(work) || o2oaUrl == null || "".equals(o2oaUrl)) {
return null;
}
String workUrl = "workmobilewithaction.html?workid=" + work;
String messageRedirectPortal = Config.weLink().getMessageRedirectPortal();
if (messageRedirectPortal != null && !"".equals(messageRedirectPortal)) {
String portal = "portalmobile.html?id=" + messageRedirectPortal;
portal = URLEncoder.encode(portal, DefaultCharset.name);
workUrl += "&redirectlink=" + portal;
}
workUrl = URLEncoder.encode(workUrl, DefaultCharset.name);
logger.info("o2oa workUrl:" + workUrl);
o2oaUrl = o2oaUrl + "welinksso.html?redirect=" + workUrl;
logger.info("o2oa 地址:" + o2oaUrl);
return o2oaUrl;
} catch (Exception e) {
logger.error(e);
}
return "";
}
18
Source : QiyeweixinConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 是否需要把企业微信消息转成超链接消息
* 根据是否配置了企业微信应用链接、是否是工作消息(目前只支持工作消息)
* @param messageType 消息类型 判断是否是工作消息
* @return
*/
private boolean needTransferLink(String messageType) {
try {
String workUrl = Config.qiyeweixin().getWorkUrl();
if (workUrl != null && !"".equals(workUrl) && workMessageTypeList().contains(messageType)) {
return true;
}
} catch (Exception e) {
logger.error(e);
}
return false;
}
18
Source : ActiveMQ.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public void destroy() {
try {
logger.info("MqActive destroy.....");
this.connection.close();
} catch (JMSException e) {
e.printStackTrace();
logger.error(e);
}
}
18
Source : DingdingConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 是否需要把钉钉消息转成markdown格式消息
* 根据是否配置了钉钉工作链接、是否是工作消息(目前只支持工作消息)
* @param messageType 消息类型 判断是否是工作消息
* @return
*/
private boolean needTransferLink(String messageType) {
try {
String workUrl = Config.dingding().getWorkUrl();
if (workUrl != null && !"".equals(workUrl) && workMessageTypeList().contains(messageType)) {
return true;
}
} catch (Exception e) {
logger.error(e);
}
return false;
}
18
Source : ThisApplication.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void destroy() {
try {
CacheManager.shutdown();
} catch (Exception e) {
logger.error(e);
}
}
18
Source : BBSConfigSettingService.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* BBS_LOGO_NAME 论坛系统名称 ADMIN_AND_ALLLEADER
*/
public void initAllSystemConfig() {
String value = null, description = null, type = null, selectContent = null;
Boolean isMultiple = false;
Integer ordernumber = 0;
value = "企业论坛";
type = "text";
selectContent = null;
isMultiple = false;
description = "论坛系统名称:可以为系统指定名称,比如以顶层组织名称作为论坛名称等等。";
try {
checkAndInitSystemConfig("BBS_LOGO_NAME", "论坛系统名称", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_LOGO_NAME' got an exception.");
logger.error(e);
}
value = " - O2OA办公软件管理系统";
type = "text";
selectContent = null;
isMultiple = false;
description = "论坛标题Tail:全站网页标题内容的后缀内容。可以为空。";
try {
checkAndInitSystemConfig("BBS_replacedLE_TAIL", "论坛标题Tail", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_replacedLE_TAIL' got an exception.");
logger.error(e);
}
value = "信息|问题|投票";
type = "select";
selectContent = "信息|问题|投票";
isMultiple = true;
description = "主题类别:可选值:信息|问题|投票,多选。";
try {
checkAndInitSystemConfig("BBS_SUBJECT_TYPECATAGORY", "主题类别", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_SUBJECT_TYPECATAGORY' got an exception.");
logger.error(e);
}
value = "Recursively";
type = "select";
selectContent = "Single|Recursively";
isMultiple = false;
description = "回复删除模式:可选值:Single|Recursively,单选。";
try {
checkAndInitSystemConfig("BBS_REPLY_DELETETYPE", "回复删除模式", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_REPLY_DELETETYPE' got an exception.");
logger.error(e);
}
value = "ASC";
type = "select";
selectContent = "ASC|DESC";
isMultiple = false;
description = "回贴排序模式:可选值:ASC|DESC, 按创建时间正序|倒序,单选。";
try {
checkAndInitSystemConfig("BBS_REPLY_SORTTYPE", "回贴排序模式", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_REPLY_SORTTYPE' got an exception.");
logger.error(e);
}
value = "DESC";
type = "select";
selectContent = "ASC|DESC";
isMultiple = false;
description = "我的回贴列表排序模式:可选值:ASC|DESC, 按创建时间正序|倒序,单选。";
try {
checkAndInitSystemConfig("BBS_MYREPLY_SORTTYPE", "我的回贴排序模式", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_MYREPLY_SORTTYPE' got an exception.");
logger.error(e);
}
value = "YES";
type = "select";
selectContent = "YES|NO";
isMultiple = false;
description = "是否允许匿名访问资源:可选值:YES|NO(允许|不允许),单选。";
try {
checkAndInitSystemConfig("BBS_ANONYMOUS_PERMISSION", "是否允许匿名访问", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'BBS_ANONYMOUS_PERMISSION' got an exception.");
logger.error(e);
}
}
18
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void put(CacheCategory category, CacheKey key, Object o) {
try {
cache().put(category, key, o);
} catch (Exception e) {
logger.error(e);
}
}
18
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static void receive(WrapClearCacheRequest wi) {
try {
if (null != cache) {
cache.receive(wi);
}
} catch (Exception e) {
logger.error(e);
}
}
18
Source : CacheManager.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public static Optional<?> get(CacheCategory category, CacheKey key) {
try {
return cache().get(category, key);
} catch (Exception e) {
logger.error(e);
}
return Optional.empty();
}
18
Source : AttendanceSettingService.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* APPEALABLE 员工申诉及申诉审批 true|false
* APPEAL_AUDITOR_TYPE 考勤结果申诉审核人确定方式 所属组织职位|所属组织属性|人员属性(默认)|指定人|指定角色
* APPEAL_AUDITOR_VALUE 考勤结果申诉审核人确定内容 直属领导(默认)
* APPEAL_CHECKER_TYPE 考勤结果申诉复核人确定方式 无(默认)|所属组织职位|所属组织属性|人员属性|指定人|指定角色
* APPEAL_CHECKER_VALUE 考勤结果申诉复核人确定内容
*/
public void initAllSystemConfig() {
String value = null, description = null, type = null, selectContent = null;
Boolean isMultiple = false;
Integer ordernumber = 0;
value = "true";
type = "select";
selectContent = null;
isMultiple = false;
description = "员工申诉及申诉审批:可选值为true|false,单值。此属性控制系统中是否允许员工对考勤结果进行申诉操作.";
try {
checkAndInitSystemConfig("APPEALABLE", "员工申诉及申诉审批", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("attendance system init system config 'APPEALABLE' got an exception.");
logger.error(e);
}
value = AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN;
type = "select";
selectContent = AppealConfig.APPEAL_AUDIFLOWTYPE_WORKFLOW + "|" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN;
isMultiple = false;
description = "考勤结果申诉审核人确定方式:可选值:" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN + "|" + AppealConfig.APPEAL_AUDIFLOWTYPE_WORKFLOW + "。此配置控制考勤结果申诉流程为自定义流程或者内置审批步骤(审核-复核)。";
try {
checkAndInitSystemConfig("APPEAL_AUDIFLOWTYPE", "考勤结果申诉流程类型", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("attendance system init system config 'APPEAL_AUDIFLOWTYPE' got an exception.");
logger.error(e);
}
value = "无";
type = "text";
selectContent = null;
isMultiple = false;
description = "考勤结果申诉流程,单值。该配置在'自定义申诉流程(" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN + ")'时,需要启动的申请流程ID。";
try {
checkAndInitSystemConfig("APPEAL_AUDIFLOW_ID", "自定义申诉流程", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'APPEAL_AUDIFLOW_ID' got an exception.");
logger.error(e);
}
value = AppealConfig.APPEAL_AUDITTYPE_UNITDUTY;
type = "select";
selectContent = AppealConfig.APPEAL_CHOOSEVALUE_AUDITTYPE;
isMultiple = false;
description = "考勤结果申诉审核人确定方式:可选值:所属组织职务|汇报对象|个人属性|指定人。此配置控制在'内置申诉流程(" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN + ")'中考勤结果申诉审核人的确定方式。";
try {
checkAndInitSystemConfig("APPEAL_AUDITOR_TYPE", "内置申请过程中考勤结果申诉审核人确定方式", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("attendance system init system config 'APPEAL_AUDITOR_TYPE' got an exception.");
logger.error(e);
}
value = "部门经理";
type = "text";
selectContent = null;
isMultiple = false;
description = "考勤结果申诉审核人确定内容:可选值为指定的人员身份,单值。该配置在'内置申诉流程(" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN + ")'中与汇报流程方式中的ADMIN_AND_ALLLEADER配合使用";
try {
checkAndInitSystemConfig("APPEAL_AUDITOR_VALUE", "内置申请过程中考勤结果申诉审核人确定内容", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'APPEAL_AUDITOR_VALUE' got an exception.");
logger.error(e);
}
value = "无";
type = "select";
selectContent = AppealConfig.APPEAL_CHOOSEVALUE_CHECKTYPE;
isMultiple = false;
description = "考勤结果申诉复核人确定方式:可选值:无|所属组织职务|汇报对象|个人属性|指定人。此配置在'内置申诉流程(" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN + ")'中控制考勤结果申诉审核人的确定方式,无-表示不需要复核。";
try {
checkAndInitSystemConfig("APPEAL_CHECKER_TYPE", "内置申请过程中考勤结果申诉复核人确定方式", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("attendance system init system config 'APPEAL_CHECKER_TYPE' got an exception.");
logger.error(e);
}
value = "无";
type = "text";
selectContent = null;
isMultiple = false;
description = "考勤结果申诉复核人确定内容:可选值为指定的人员身份,单值。该配置在'内置申诉流程(" + AppealConfig.APPEAL_AUDIFLOWTYPE_BUILTIN + ")'中与汇报流程方式中的ADMIN_AND_ALLLEADER配合使用";
try {
checkAndInitSystemConfig("APPEAL_CHECKER_VALUE", "内置申请过程中考勤结果申诉复核人确定内容", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'APPEAL_CHECKER_VALUE' got an exception.");
logger.error(e);
}
value = "无";
type = "select";
selectContent = "无|周六|周日";
isMultiple = false;
description = "周末设置描述:选择周六或周日。选中的为周末,未选中的按工作日计算";
try {
checkAndInitSystemConfig("ATTENDANCE_WEEKEND", "周末计算日期设置", value, description, type, selectContent, isMultiple, ++ordernumber);
} catch (Exception e) {
logger.warn("system init system config 'APPEAL_CHECKER_VALUE' got an exception.");
logger.error(e);
}
}
17
Source : CrawlWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private void update(List<String> references) throws Exception {
for (String reference : references) {
try {
ThisApplication.context().applications().getQuery(x_query_service_processing.clreplaced, Applications.joinQueryUri("segment", "crawl", "workcompleted", reference), reference);
} catch (Exception e) {
logger.error(e);
}
}
}
17
Source : CrawlWork.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private void update(List<String> references) throws Exception {
for (String reference : references) {
try {
ThisApplication.context().applications().getQuery(x_query_service_processing.clreplaced, Applications.joinQueryUri("segment", "crawl", "work", reference), reference);
} catch (Exception e) {
logger.error(e);
}
}
}
17
Source : CrawlCms.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private void update(List<String> references) throws Exception {
for (String reference : references) {
try {
ThisApplication.context().applications().getQuery(x_query_service_processing.clreplaced, Applications.joinQueryUri("segment", "crawl", "cms", reference), reference);
} catch (Exception e) {
logger.error(e);
}
}
}
17
Source : ZhengwuDingdingSyncOrganizationTrigger.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/* 向列表发送一个同步信号 */
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
if (pirmaryCenter()) {
ThisApplication.zhengwuDingdingSyncOrganizationCallbackRequest.add(new Object());
}
} catch (Exception e) {
logger.error(e);
throw new JobExecutionException(e);
}
}
17
Source : FireSchedule.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
if (pirmaryCenter()) {
this.fire();
}
} catch (Exception e) {
logger.error(e);
throw new JobExecutionException(e);
}
}
17
Source : CleanupCode.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
if (pirmaryCenter()) {
cleanupCode();
}
} catch (Exception e) {
logger.error(e);
throw new JobExecutionException(e);
}
}
17
Source : CleanupCaptcha.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
try {
if (pirmaryCenter()) {
cleanupCaptcha();
}
} catch (Exception e) {
logger.error(e);
throw new JobExecutionException(e);
}
}
17
Source : Expire.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private void expire(Task task) {
try {
ThisApplication.context().applications().getQuery(x_processplatform_service_processing.clreplaced, Applications.joinQueryUri("task", task.getId(), "expire"), task.getJob()).getData(WoId.clreplaced);
} catch (Exception e) {
ExceptionExpire exceptionExpire = new ExceptionExpire(e, task.getId(), task.getreplacedle(), task.getSequence());
logger.error(exceptionExpire);
}
}
17
Source : ActionListWithJob.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private List<WoTask> tasks(String job) {
List<WoTask> os = new ArrayList<>();
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
os = emc.fetchEqual(Task.clreplaced, WoTask.copier, WoTask.job_FIELDNAME, job).stream().sorted(Comparator.comparing(Task::getStartTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
} catch (Exception e) {
logger.error(e);
}
return os;
}
17
Source : ActionListRollbackWithWorkOrWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private List<Wo> workLogs(String job) {
List<Wo> os = new ArrayList<>();
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
os = emc.fetchEqual(WorkLog.clreplaced, Wo.copier, WorkLog.job_FIELDNAME, job).stream().filter(o -> (!BooleanUtils.isTrue(o.getSplitting())) && (Objects.equals(o.getArrivedActivityType(), ActivityType.manual))).sorted(Comparator.comparing(WorkLog::getCreateTime, Comparator.nullsLast(Date::compareTo))).collect(Collectors.toList());
} catch (Exception e) {
logger.error(e);
}
return os;
}
17
Source : V2GetWorkOrWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Void> creatorUnitFuture(String creatorUnit, Wo wo) {
return CompletableFuture.runAsync(() -> {
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
Business business = new Business(emc);
wo.setCreatorUnit(business.organization().unit().getObject(creatorUnit));
} catch (Exception e) {
logger.error(e);
}
});
}
17
Source : V2GetWorkOrWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Void> creatorPersonFuture(String creatorPerson, Wo wo) {
return CompletableFuture.runAsync(() -> {
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
Business business = new Business(emc);
wo.setCreatorPerson(business.organization().person().getObject(creatorPerson));
} catch (Exception e) {
logger.error(e);
}
});
}
17
Source : V2GetWorkOrWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Void> workCompletedJsonFuture(WorkCompleted workCompleted, Wo wo) {
return CompletableFuture.runAsync(() -> {
try {
wo.setWork(gson.toJsonTree(WoWorkCompleted.copier.copy(workCompleted)));
} catch (Exception e) {
logger.error(e);
}
});
}
17
Source : V2GetWorkOrWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Void> creatorIdenreplacedyFuture(String creatorIdenreplacedy, Wo wo) {
return CompletableFuture.runAsync(() -> {
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
Business business = new Business(emc);
wo.setCreatorIdenreplacedy(business.organization().idenreplacedy().getObject(creatorIdenreplacedy));
} catch (Exception e) {
logger.error(e);
}
});
}
17
Source : V2GetWorkOrWorkCompleted.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Void> workJsonFuture(Work work, Wo wo) {
return CompletableFuture.runAsync(() -> {
try {
wo.setWork(gson.toJsonTree(WoWork.copier.copy(work)));
} catch (Exception e) {
logger.error(e);
}
});
}
17
Source : ActionCountWithPerson.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Long> reviewFuture(String dn) {
return CompletableFuture.supplyAsync(() -> {
Long count = 0L;
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
count = emc.countEqual(Review.clreplaced, Review.person_FIELDNAME, dn);
} catch (Exception e) {
logger.error(e);
}
return count;
});
}
17
Source : ActionCountWithPerson.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Long> readCompletedFuture(String dn) {
return CompletableFuture.supplyAsync(() -> {
Long count = 0L;
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
count = emc.countEqual(ReadCompleted.clreplaced, ReadCompleted.person_FIELDNAME, dn);
} catch (Exception e) {
logger.error(e);
}
return count;
});
}
17
Source : ActionCountWithPerson.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Long> readFuture(String dn) {
return CompletableFuture.supplyAsync(() -> {
Long count = 0L;
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
count = emc.countEqual(Read.clreplaced, Read.person_FIELDNAME, dn);
} catch (Exception e) {
logger.error(e);
}
return count;
});
}
17
Source : ActionCountWithPerson.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
private CompletableFuture<Long> taskFuture(String dn) {
return CompletableFuture.supplyAsync(() -> {
Long count = 0L;
try (EnreplacedyManagerContainer emc = EnreplacedyManagerContainerFactory.instance().create()) {
count = emc.countEqual(Task.clreplaced, Task.person_FIELDNAME, dn);
} catch (Exception e) {
logger.error(e);
}
return count;
});
}
17
Source : DateOperation.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 得到两个时间之前的分差
* @param date1 yyyy-MM-dd HH:mm:ss
* @param date2 yyyy-MM-dd HH:mm:ss
* @return
*/
public long getDiff(Date date1, Date date2) {
long dayNumber = 0;
// 1小时=60分钟=3600秒=3600000
long mins = 60L * 1000L;
// long day= 24L * 60L * 60L * 1000L;计算天数之差
try {
dayNumber = (date2.getTime() - date1.getTime()) / mins;
} catch (Exception e) {
logger.warn("系统获取得到两个时间之前的分差发生异常");
logger.error(e);
}
return dayNumber;
}
17
Source : DateOperation.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 日期格式转换
* 从YYYY-MM-DD转换到YYYYMMDD
* @param date
* @throws ParseException
*/
public String changeDateFormat(String dateString) {
Date date;
String rereplaced = null;
try {
if ("".equals(dateString)) {
dateString = "0000-00-00";
}
date = format1.parse(dateString);
rereplaced = format5.format(date);
} catch (ParseException e) {
try {
date = format1.parse("0000-00-00");
} catch (ParseException e1) {
logger.warn("系统日期格式转换发生异常");
logger.error(e);
}
logger.warn("系统日期格式转换发生异常");
logger.error(e);
}
return rereplaced;
}
17
Source : DateOperation.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 将时间格式转换为 **月**日**时**分的格式
* @param dateString
* @param style
* @return
* @throws Exception
*/
public String getDateCNString(String dateString, String style) throws Exception {
StringBuffer ch_date_string = new StringBuffer();
Date _date = null;
try {
_date = getDateFromString(dateString, style);
} catch (Exception e) {
logger.warn("系统getDateCNString日期格式转换发生异常");
logger.error(e);
}
if (_date == null) {
_date = new Date();
}
String year = getYear(_date);
String month = getMonth(_date);
String day = getDay(_date);
String hour = getHour(_date);
String min = getMinites(_date);
ch_date_string.append(year);
ch_date_string.append("年");
ch_date_string.append(month);
ch_date_string.append("月");
ch_date_string.append(day);
ch_date_string.append("日");
ch_date_string.append(hour);
ch_date_string.append("时");
ch_date_string.append(min);
ch_date_string.append("分");
return ch_date_string.toString();
}
17
Source : DateOperation.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 将时间格式转换为 **月**日**时**分**秒 的格式
* @param dateString
* @param style
* @return
* @throws Exception
*/
public String getDateCNString2(String dateString, String style) throws Exception {
StringBuffer ch_date_string = new StringBuffer();
Date _date = null;
try {
_date = getDateFromString(dateString, style);
} catch (Exception e) {
logger.warn("系统getDateCNString2日期格式转换发生异常");
logger.error(e);
}
if (_date == null) {
_date = new Date();
}
String year = getYear(_date);
String month = getMonth(_date);
String day = getDay(_date);
String hour = getHour(_date);
String min = getMinites(_date);
String sec = getSeconds(_date);
ch_date_string.append(year);
ch_date_string.append("年");
ch_date_string.append(month);
ch_date_string.append("月");
ch_date_string.append(day);
ch_date_string.append("日");
ch_date_string.append(hour);
ch_date_string.append("时");
ch_date_string.append(min);
ch_date_string.append("分");
ch_date_string.append(sec);
ch_date_string.append("秒");
return ch_date_string.toString();
}
17
Source : WeLinkConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 获取workid
* @param messageBody
* @return
*/
private String getWorkIdFromBody(String messageBody) {
try {
JsonObject object = new JsonParser().parse(messageBody).getAsJsonObject();
return object.get("work").getreplacedtring();
} catch (Exception e) {
logger.error(e);
}
return "";
}
17
Source : QiyeweixinConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 生成单点登录和打开工作的地址
* @param messageBody
* @return
*/
private String getQywxOpenWorkUrl(String messageBody) {
try {
String work = getWorkIdFromBody(messageBody);
String o2oaUrl = Config.qiyeweixin().getWorkUrl();
String corpId = Config.qiyeweixin().getCorpId();
String agentId = Config.qiyeweixin().getAgentId();
if (work == null || "".equals(work) || o2oaUrl == null || "".equals(o2oaUrl) || corpId == null || "".equals(corpId) || agentId == null || "".equals(agentId)) {
return null;
}
String workUrl = "workmobilewithaction.html?workid=" + work;
String messageRedirectPortal = Config.qiyeweixin().getMessageRedirectPortal();
if (messageRedirectPortal != null && !"".equals(messageRedirectPortal)) {
String portal = "portalmobile.html?id=" + messageRedirectPortal;
portal = URLEncoder.encode(portal, DefaultCharset.name);
workUrl += "&redirectlink=" + portal;
}
workUrl = URLEncoder.encode(workUrl, DefaultCharset.name);
o2oaUrl = o2oaUrl + "qiyeweixinsso.html?redirect=" + workUrl;
logger.info("o2oa 地址:" + o2oaUrl);
o2oaUrl = URLEncoder.encode(o2oaUrl, DefaultCharset.name);
logger.info("encode url :" + o2oaUrl);
String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + corpId + "&response_type=code&scope=snsapi_base" + "&agentid=" + agentId + "&redirect_uri=" + o2oaUrl + "&#wechat_redirect";
logger.info("final url :" + url);
return url;
} catch (Exception e) {
logger.error(e);
}
return "";
}
17
Source : DingdingConsumeQueue.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 生成单点登录和打开工作的地址
* @param messageBody
* @return
*/
private String getDingdingOpenWorkUrl(String messageBody) {
try {
String work = getWorkIdFromBody(messageBody);
String o2oaUrl = Config.dingding().getWorkUrl();
if (work == null || "".equals(work) || o2oaUrl == null || "".equals(o2oaUrl)) {
return null;
}
String workUrl = "workmobilewithaction.html?workid=" + work;
String messageRedirectPortal = Config.dingding().getMessageRedirectPortal();
if (messageRedirectPortal != null && !"".equals(messageRedirectPortal)) {
String portal = "portalmobile.html?id=" + messageRedirectPortal;
portal = URLEncoder.encode(portal, DefaultCharset.name);
workUrl += "&redirectlink=" + portal;
}
workUrl = URLEncoder.encode(workUrl, DefaultCharset.name);
logger.info("o2oa workUrl:" + workUrl);
o2oaUrl = o2oaUrl + "ddsso.html?redirect=" + workUrl;
logger.info("o2oa 地址:" + o2oaUrl);
return o2oaUrl;
} catch (Exception e) {
logger.error(e);
}
return "";
}
17
Source : HotPictureInfoServiceAdv.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
public void doreplacedentExistsCheck() {
List<HotPictureInfo> allHotPictureInfoList = null;
// 1、先查询出所有的信息列表,按照排序号和更新时间倒排序
try {
allHotPictureInfoList = listAll();
} catch (Exception e) {
logger.error(e);
}
if (allHotPictureInfoList != null && !allHotPictureInfoList.isEmpty()) {
int[] idx = { 0 };
allHotPictureInfoList.forEach(e -> {
try {
ThisApplication.queueLoginRecord.send(new DoreplacedentCheckQueue(++idx[0], e.getInfoId(), e.getApplication(), e.getreplacedle()));
} catch (Exception e1) {
e1.printStackTrace();
}
});
}
logger.info("Hotpicture doreplacedent exists check excute completed.");
}
17
Source : DateOperation.java
with GNU Affero General Public License v3.0
from o2oa
with GNU Affero General Public License v3.0
from o2oa
/**
* 得到两个时间之前的分差
* @param date1 yyyy-MM-dd HH:mm:ss
* @param date2 yyyy-MM-dd HH:mm:ss
* @return
*/
public long getDeff(Date date1, Date date2) {
long dayNumber = 0;
// 1小时=60分钟=3600秒=3600000
long mins = 60L * 1000L;
// long day= 24L * 60L * 60L * 1000L;计算天数之差
try {
dayNumber = (date2.getTime() - date1.getTime()) / mins;
} catch (Exception e) {
logger.warn("系统获取得到两个时间之前的分差发生异常");
logger.error(e);
}
return dayNumber;
}
See More Examples