Commit 9aec914e by liuyu

2023年05/26 模板set 旧模板空判断

parent 257f8738
...@@ -19,6 +19,7 @@ import com.zhiwei.middleware.automatic.son.util.Tools; ...@@ -19,6 +19,7 @@ import com.zhiwei.middleware.automatic.son.util.Tools;
import org.apache.commons.lang3.time.FastDateFormat; import org.apache.commons.lang3.time.FastDateFormat;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.elasticsearch.common.Strings;
import org.elasticsearch.index.query.BoolQueryBuilder; import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHits; import org.elasticsearch.search.SearchHits;
...@@ -202,10 +203,10 @@ public class TemplateTitleServiceImpl implements TemplateTitleService { ...@@ -202,10 +203,10 @@ public class TemplateTitleServiceImpl implements TemplateTitleService {
if (redissonUtil.tryLock(lockKey, 5, 5)) { if (redissonUtil.tryLock(lockKey, 5, 5)) {
String mapKey = Tools.assembleKey(GenericAttribute.REDIS_MAP_KEY, group); String mapKey = Tools.assembleKey(GenericAttribute.REDIS_MAP_KEY, group);
String mapKeyValue = redissonUtil.getMapKeyValue(mapKey, title); String mapKeyValue = redissonUtil.getMapKeyValue(mapKey, title);
TemplateTitleVo titleVo = JSONObject.parseObject(mapKeyValue, TemplateTitleVo.class); if (Strings.isEmpty(mapKeyValue)) {
if (Objects.isNull(titleVo)) {
return; return;
} }
TemplateTitleVo titleVo = JSONObject.parseObject(mapKeyValue, TemplateTitleVo.class);
if (Objects.isNull(templateTitleVo)) { if (Objects.isNull(templateTitleVo)) {
templateTitleVo = titleVo; templateTitleVo = titleVo;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment