This commit is contained in:
wangliwen 2022-06-10 09:14:09 +08:00
parent 87ac346c28
commit 18e27f3038
1 changed files with 3 additions and 3 deletions

View File

@ -43,11 +43,11 @@ public class InsertTaskListJob implements ITask {
Map<String, Object> key = (Map<String, Object>) index;
String eventType = (String) key.get("eventType");
String eventCnName = (String) key.get("eventCnName");
JSONObject taskListBody = shangTangService.tasklist(eventType);
if (taskListBody.isEmpty()) {
Optional<JSONObject> taskListBody = Optional.ofNullable(shangTangService.tasklist(eventType));
if (!taskListBody.isPresent() || taskListBody.get().isEmpty()) {
return;
}
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.getJSONObject("data"));
Optional<JSONObject> taskdatajobj = Optional.ofNullable(taskListBody.get().getJSONObject("data"));
taskdatajobj.ifPresent(task -> {
Optional<JSONArray> taskdatajobjJSONArray = Optional.ofNullable(task.getJSONArray("dataList"));
taskdatajobjJSONArray.orElse(new JSONArray()).stream().forEach(index_ -> {