|
@@ -27,9 +27,7 @@ import org.springframework.stereotype.Component;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static com.tzld.piaoquan.wecom.common.constant.WeComConstant.GET_HISTORY_DATA_URL;
|
|
|
|
|
@@ -226,6 +224,10 @@ public class WeComHistoryDataJob {
|
|
|
if (total == null || total == 0) {
|
|
|
return;
|
|
|
}
|
|
|
+ Set<String> filterStatus = new HashSet<String>() {{
|
|
|
+ add("sended");
|
|
|
+ add("waiting_confirm");
|
|
|
+ }};
|
|
|
List<AlertMessage> alertMessageList = new ArrayList<>();
|
|
|
int page = total / size + 1;
|
|
|
for (int n = 0; n < page; n++) {
|
|
@@ -237,7 +239,6 @@ public class WeComHistoryDataJob {
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
JSONArray jsonArray = jsonObject.getJSONArray("missions");
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
-
|
|
|
JSONArray attachments = jsonArray.getJSONObject(i).getJSONObject("msg_data").getJSONArray("attachments");
|
|
|
List<Long> videoIds = new ArrayList<>();
|
|
|
for (int j = 0; j < attachments.size(); j++) {
|
|
@@ -247,7 +248,7 @@ public class WeComHistoryDataJob {
|
|
|
}
|
|
|
JSONArray subMissionList = jsonArray.getJSONObject(i).getJSONArray("sub_mission_list");
|
|
|
for (int k = 0; k < subMissionList.size(); k++) {
|
|
|
- if (!"sended".equals(subMissionList.getJSONObject(k).getString("status"))) {
|
|
|
+ if (!filterStatus.contains(subMissionList.getJSONObject(k).getString("status"))) {
|
|
|
Long messageId = jsonArray.getJSONObject(i).getLong("id");
|
|
|
AlertMessageExample example = new AlertMessageExample();
|
|
|
example.createCriteria().andMessageIdEqualTo(messageId);
|