|
|
@@ -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);
|