Commit 16e2d7b7 by liuyu

2023年07/10 避免失效后 重新聚合后id一致

parent cadd29e3
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
<groupId>com.zhiwei.base</groupId> <groupId>com.zhiwei.base</groupId>
<artifactId>base-objects-application</artifactId> <artifactId>base-objects-application</artifactId>
<version>${base.version}</version> <version>${base.version}</version>
<scope>provided</scope>
</dependency> </dependency>
......
...@@ -32,7 +32,8 @@ public class TemplateTitleVo implements Serializable { ...@@ -32,7 +32,8 @@ public class TemplateTitleVo implements Serializable {
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
e.printStackTrace(); e.printStackTrace();
} }
String info = this.templateTitle + group; // 避免失效后 重新聚合后id一致
String info = this.templateTitle + group + System.currentTimeMillis();
byte[] hash = sMd5Digest.digest(info.getBytes()); byte[] hash = sMd5Digest.digest(info.getBytes());
BigInteger numValue = new BigInteger(1, hash); BigInteger numValue = new BigInteger(1, hash);
this.id = numValue.toString(16); this.id = numValue.toString(16);
......
...@@ -300,9 +300,6 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo ...@@ -300,9 +300,6 @@ public class TaskServiceCommon extends BaseTaskTypePair<TaskServiceCommon.TaskCo
// 相似度最高的模板信息 // 相似度最高的模板信息
Map<String, Object> similarMap = new HashMap<>(); Map<String, Object> similarMap = new HashMap<>();
for (TemplateTitleVo templateTitleVo : titleVoMap.values()) { for (TemplateTitleVo templateTitleVo : titleVoMap.values()) {
if (Objects.isNull(templateTitleVo.getId())) {
templateTitleVo.buildId(group);
}
// 过滤掉以重置的模板 // 过滤掉以重置的模板
if (templateTitleVo.getStatus() == TemplateStatus.已重置 || Tools.isEmpty(templateTitleVo.getMtag())) { if (templateTitleVo.getStatus() == TemplateStatus.已重置 || Tools.isEmpty(templateTitleVo.getMtag())) {
continue; continue;
......
...@@ -203,9 +203,6 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta ...@@ -203,9 +203,6 @@ public class TaskServiceTemplate extends BaseTaskTypePair<TaskServiceTemplate.Ta
.filter(e -> { .filter(e -> {
String title = e.getKey(); String title = e.getKey();
TemplateTitleVo templateTitleVo = e.getValue(); TemplateTitleVo templateTitleVo = e.getValue();
if (Objects.isNull(templateTitleVo.getId())) {
templateTitleVo.buildId(group);
}
long updateTime = templateTitleVo.getUpdateTime().getTime(); long updateTime = templateTitleVo.getUpdateTime().getTime();
// 移除1天有效期外的数据 // 移除1天有效期外的数据
if (System.currentTimeMillis() - updateTime > ONE_DAY * 1000) { if (System.currentTimeMillis() - updateTime > ONE_DAY * 1000) {
......
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