XXL-JOB任务调度中心实现执行备注换行
XXL-JOB任务调度中心实现执行备注换行
public enum RedisKeyEnum {
//
SEPARATOR(1, ":", "分隔符"),
YC_SUPPLIER(2, "ycSupplier" + SEPARATOR.key, "易仓供应商"),
YC_PURCHASER(3, "ycPurchaser" + SEPARATOR.key, "易仓采购员"),
YC_SALE_STATE(4, "ycSaleState" + SEPARATOR.key, "易仓销售状态"),
PRODUCT_ALL_EXPORT(5, "product_all_export", "产品全量导出"),
SKC_DAILY_SALE_LIFECYCLE_PREFIX(6, "SALE:LIFECYCLE", "生命周期前缀"),
// SALE:LIFECYCLE:HEAD:skc:站点
SKC_DAILY_SALE_LIFECYCLE_HEAD(7, "SALE:LIFECYCLE:HEAD:{0}:{1}", "生命周期头部"),
// SALE:LIFECYCLE:FLOWS:skc:站点
SKC_DAILY_SALE_LIFECYCLE_FLOWS(8, "SALE:LIFECYCLE:FLOWS:{0}:{1}", "生命周期流量"),
// SALE:LIFECYCLE:REFUND:skc:站点
SKC_DAILY_SALE_LIFECYCLE_REFUND(9, "SALE:LIFECYCLE:REFUND:{0}:{1}", "生命周期退货"),
// SALE:LIFECYCLE:REFUND:REASON:skc:站点
SKC_DAILY_SALE_LIFECYCLE_REFUND_REASON(10, "SALE:LIFECYCLE:REFUND:REASON:{0}:{1}", "生命周期退货原因"),
// SALE:LIFECYCLE:SALE:skc:站点
SKC_DAILY_SALE_LIFECYCLE_SALE(11, "SALE:LIFECYCLE:SALE:{0}:{1}", "生命周期销售表现"),
// SALE:LIFECYCLE:STOCK:skc
SKC_DAILY_SALE_LIFECYCLE_STOCK(12, "SALE:LIFECYCLE:STOCK:{0}", "生命周期供应链表现"),
// SALE:LIFECYCLE:REVIEW:skc:站点
SKC_DAILY_SALE_LIFECYCLE_REVIEW(13, "SALE:LIFECYCLE:REVIEW:{0}:{1}", "生命周期评论表现"),
MEMBER_FORM_DEPART(14, "MEMBER:PRODUCT:CENTER:DEPART", "产品中心和生产供应链中心成员信息"),
MEMBER_FORM_DEPART_INNOVATE(15, "MEMBER:PRODUCT:CENTER:DEPART:INNOVATE", "产品中心和创新业务部成员信息"),
INTELLIGENT_STOCK(16, "export-stock-process", "智能备货导出"),
// PLM: USERID : 接口名称 : 请求参数
PLM_IDEMPOTENCY_LIMIT(17, "PLM:{0},{1},{2}", "PLM接口幂等性限制");
}
@XxlJob("jedisCleanCacheTaskHandler")
@Override
public ReturnT<String> execute(String s) {
List<String> keys = new ArrayList<>();
for (RedisKeyEnum type : RedisKeyEnum.values()) {
if (type.key.equals(s)) {
jedisService.del(s);
beanComparison.create("定时清理缓存", ProcConstants.BizLogType.PERIODICALLY_CLEAN_CACHE.getValue(), 103L);
return ReturnT.SUCCESS;
} else {
keys.add(type.desc + "的key值:" + type.key + "<br>");
}
}
ReturnT.FAIL.setMsg(keys.toString());
return ReturnT.FAIL;
}
设定清理缓存的定时任务,当传入的key与枚举中的key值相匹配时,则清理缓存。不匹配时则将枚举中的key全部输出到任务调度中心。此时通过list集合转换为String进行输出。在调度中心进行换行输出时,加入换行符”<br>
"
添加换行符之前的展示效果
添加换行符之后的展示效果:
本文来自博客园,作者:寒露凝珠,转载请注明原文链接:https://www.cnblogs.com/china-soldier/p/16285066.html