提交 b353cef6 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'hotfix/lastManualScript' into 'master'

修复在最后的人工环节在'活动流转完成'事件中无法获取recordList

See merge request o2oa/o2oa!2617

(cherry picked from commit a8b72cf7)

5c982ec1 修复在最后的人工环节在'活动流转完成'事件中无法获取recordList
833d1548 增加输出recordList的排序
上级 1db73b15
...@@ -108,9 +108,17 @@ public class WorkContext { ...@@ -108,9 +108,17 @@ public class WorkContext {
list.addAll(aeiObjects.getRecords()); list.addAll(aeiObjects.getRecords());
list.addAll(aeiObjects.getCreateRecords()); list.addAll(aeiObjects.getCreateRecords());
} }
return gson.toJson( List<Record> records = list.stream()
list.stream().filter(o -> StringUtils.equals(o.getWork(), this.aeiObjects.getWork().getId())) .filter(o -> StringUtils.equals(o.getWork(), this.aeiObjects.getWork().getId()))
.collect(Collectors.toList())); .collect(Collectors.toList());
// 考虑到比如已经是最后一个人工环节,那么work已经转为workCompleted,那么直接返回全部record
if (records.isEmpty()) {
return gson.toJson(list.stream().sorted(Comparator.nullsLast(Comparator.comparing(Record::getOrder)))
.collect(Collectors.toList()));
} else {
return gson.toJson(records.stream().sorted(Comparator.nullsLast(Comparator.comparing(Record::getOrder)))
.collect(Collectors.toList()));
}
} catch (Exception e) { } catch (Exception e) {
throw new IllegalStateException("getRecordList error.", e); throw new IllegalStateException("getRecordList error.", e);
} }
...@@ -333,6 +341,7 @@ public class WorkContext { ...@@ -333,6 +341,7 @@ public class WorkContext {
throw new IllegalStateException("getReadCompletedList error.", e); throw new IllegalStateException("getReadCompletedList error.", e);
} }
} }
@Deprecated(forRemoval = true, since = "never use.") @Deprecated(forRemoval = true, since = "never use.")
public String getReviewList() { public String getReviewList() {
try { try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册