提交 a041c453 编写于 作者: Z zhourui

退回getForm

上级 235099d0
......@@ -48,26 +48,19 @@ class V2LookupWorkOrWorkCompleted extends BaseAction {
if (optional.isPresent()) {
this.wo = (Wo) optional.get();
} else {
// 必须重新取出,因为getWorkWorkCompletedForm的form是从缓存中取出,关联值是老的,要重新计算etag需要重新获取更新后的值.
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
this.form = emc.find(form.getId(), Form.class);
}
if (null != this.form) {
List<String> list = new ArrayList<>();
CompletableFuture<List<String>> relatedFormFuture = this
.relatedFormFuture(this.form.getProperties());
CompletableFuture<List<String>> relatedScriptFuture = this
.relatedScriptFuture(this.form.getProperties());
list.add(this.form.getId() + this.form.getUpdateTime().getTime());
list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
list = list.stream().sorted().collect(Collectors.toList());
this.wo.setId(this.form.getId());
CRC32 crc = new CRC32();
crc.update(StringUtils.join(list, "#").getBytes());
this.wo.setCacheTag(crc.getValue() + "");
CacheManager.put(cacheCategory, cacheKey, wo);
}
List<String> list = new ArrayList<>();
CompletableFuture<List<String>> relatedFormFuture = this.relatedFormFuture(this.form.getProperties());
CompletableFuture<List<String>> relatedScriptFuture = this
.relatedScriptFuture(this.form.getProperties());
list.add(this.form.getId() + this.form.getUpdateTime().getTime());
list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
list = list.stream().sorted().collect(Collectors.toList());
this.wo.setId(this.form.getId());
CRC32 crc = new CRC32();
crc.update(StringUtils.join(list, "#").getBytes());
this.wo.setCacheTag(crc.getValue() + "");
CacheManager.put(cacheCategory, cacheKey, wo);
}
}
result.setData(wo);
......
......@@ -48,26 +48,19 @@ class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
if (optional.isPresent()) {
this.wo = (Wo) optional.get();
} else {
// 必须重新取出,因为getWorkWorkCompletedForm的form是从缓存中取出,关联值是老的,要重新计算etag需要重新获取更新后的值.
try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
this.form = emc.find(form.getId(), Form.class);
}
if (null != this.form) {
List<String> list = new ArrayList<>();
CompletableFuture<List<String>> relatedFormFuture = this
.relatedFormFuture(this.form.getProperties());
CompletableFuture<List<String>> relatedScriptFuture = this
.relatedScriptFuture(this.form.getProperties());
list.add(this.form.getId() + this.form.getUpdateTime().getTime());
list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
list = list.stream().sorted().collect(Collectors.toList());
this.wo.setId(this.form.getId());
CRC32 crc = new CRC32();
crc.update(StringUtils.join(list, "#").getBytes());
this.wo.setCacheTag(crc.getValue() + "");
CacheManager.put(cacheCategory, cacheKey, wo);
}
List<String> list = new ArrayList<>();
CompletableFuture<List<String>> relatedFormFuture = this.relatedFormFuture(this.form.getProperties());
CompletableFuture<List<String>> relatedScriptFuture = this
.relatedScriptFuture(this.form.getProperties());
list.add(this.form.getId() + this.form.getUpdateTime().getTime());
list.addAll(relatedFormFuture.get(10, TimeUnit.SECONDS));
list.addAll(relatedScriptFuture.get(10, TimeUnit.SECONDS));
list = list.stream().sorted().collect(Collectors.toList());
this.wo.setId(this.form.getId());
CRC32 crc = new CRC32();
crc.update(StringUtils.join(list, "#").getBytes());
this.wo.setCacheTag(crc.getValue() + "");
CacheManager.put(cacheCategory, cacheKey, wo);
}
}
result.setData(wo);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册