|
|
@ -1,26 +1,21 @@
|
|
|
|
package com.ruoyi.quartz.task;
|
|
|
|
package com.ruoyi.quartz.task;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.extra.template.Template;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.google.gson.internal.LinkedTreeMap;
|
|
|
|
import com.google.gson.internal.LinkedTreeMap;
|
|
|
|
import com.lark.oapi.service.bitable.v1.model.AppTableRecord;
|
|
|
|
import com.lark.oapi.service.bitable.v1.model.AppTableRecord;
|
|
|
|
import com.lark.oapi.service.bitable.v1.model.ListAppTableRecordRespBody;
|
|
|
|
import com.lark.oapi.service.bitable.v1.model.ListAppTableRecordRespBody;
|
|
|
|
|
|
|
|
import com.lark.oapi.service.contact.v3.model.GetUserRespBody;
|
|
|
|
import com.ruoyi.common.enums.*;
|
|
|
|
import com.ruoyi.common.enums.*;
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.LarkRobotHelper;
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.LarkRobotHelper;
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper;
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.LarkTableHelper;
|
|
|
|
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.LarkUserHelper;
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.script.LarkTableFilterScriptHelper;
|
|
|
|
import com.ruoyi.flyingbook.LarkHelper.script.LarkTableFilterScriptHelper;
|
|
|
|
import com.ruoyi.flyingbook.domain.EventLog;
|
|
|
|
import com.ruoyi.flyingbook.domain.*;
|
|
|
|
import com.ruoyi.flyingbook.domain.LarkCompanyTableInfo;
|
|
|
|
|
|
|
|
import com.ruoyi.flyingbook.domain.LarkTableConfiguration;
|
|
|
|
|
|
|
|
import com.ruoyi.flyingbook.domain.LarkTemplate;
|
|
|
|
|
|
|
|
import com.ruoyi.flyingbook.domain.lark.LarkRobotRequest;
|
|
|
|
import com.ruoyi.flyingbook.domain.lark.LarkRobotRequest;
|
|
|
|
import com.ruoyi.flyingbook.domain.lark.LarkTableRequest;
|
|
|
|
import com.ruoyi.flyingbook.domain.lark.LarkTableRequest;
|
|
|
|
import com.ruoyi.flyingbook.mapper.EventLogMapper;
|
|
|
|
import com.ruoyi.flyingbook.domain.lark.LarkUserRequest;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkTableConfigurationMapper;
|
|
|
|
import com.ruoyi.flyingbook.mapper.*;
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkTableRelationMapper;
|
|
|
|
|
|
|
|
import com.ruoyi.flyingbook.mapper.LarkTemplateMapper;
|
|
|
|
|
|
|
|
import com.ruoyi.quartz.helper.OkHttpHelper;
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@ -46,12 +41,16 @@ import java.util.stream.Collectors;
|
|
|
|
@Component("scheduledRemindersTask")
|
|
|
|
@Component("scheduledRemindersTask")
|
|
|
|
public class ScheduledRemindersTask {
|
|
|
|
public class ScheduledRemindersTask {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
protected LarkUserHelper larkUserHelper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private LarkTableRelationMapper larkTableRelationMapper;
|
|
|
|
private LarkTableRelationMapper larkTableRelationMapper;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private LarkTableHelper larkTableHelper;
|
|
|
|
private LarkTableHelper larkTableHelper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private LarkTableRowRelationMapper larkTableRowRelationMapper;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
private LarkTemplateMapper larkTemplateMapper;
|
|
|
|
private LarkTemplateMapper larkTemplateMapper;
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private LarkTableConfigurationMapper larkTableConfigurationMapper;
|
|
|
|
private LarkTableConfigurationMapper larkTableConfigurationMapper;
|
|
|
@ -78,7 +77,7 @@ public class ScheduledRemindersTask {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<EventLog> logList = new ArrayList<>();
|
|
|
|
List<EventLog> logList = new ArrayList<>();
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
// LocalDateTime now = LocalDateTime.of(2023, 4, 23, 20, 0);
|
|
|
|
// LocalDateTime now = LocalDateTime.of(2023, 5, 4, 20, 0);
|
|
|
|
for (LarkCompanyTableInfo larkCompanyTableInfo : larkList) {
|
|
|
|
for (LarkCompanyTableInfo larkCompanyTableInfo : larkList) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
List<LarkTableConfiguration> larkConfiguration = this.getLarkConfiguration(larkCompanyTableInfo);
|
|
|
|
List<LarkTableConfiguration> larkConfiguration = this.getLarkConfiguration(larkCompanyTableInfo);
|
|
|
@ -89,12 +88,12 @@ public class ScheduledRemindersTask {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ConfigurationSubTypeEnum.REMINDER_AROUND.equals(subType)) {
|
|
|
|
if (ConfigurationSubTypeEnum.REMINDER_AROUND.equals(subType)) {
|
|
|
|
String script = LarkTableFilterScriptHelper.buildTimeRange(larkTableConfiguration, ConfigurationSubTypeEnum.REMINDER_BEFORE, RANGE_KEY, now);
|
|
|
|
String script = LarkTableFilterScriptHelper.buildTimeRange(larkTableConfiguration, ConfigurationSubTypeEnum.REMINDER_BEFORE, RANGE_KEY, now);
|
|
|
|
this.sendMessage(script, larkCompanyTableInfo, logList,larkTableConfiguration,now);
|
|
|
|
this.sendMessage(script, larkCompanyTableInfo, logList, larkTableConfiguration, now);
|
|
|
|
script = LarkTableFilterScriptHelper.buildTimeRange(larkTableConfiguration, ConfigurationSubTypeEnum.REMINDER_AFTER, RANGE_KEY, now);
|
|
|
|
script = LarkTableFilterScriptHelper.buildTimeRange(larkTableConfiguration, ConfigurationSubTypeEnum.REMINDER_AFTER, RANGE_KEY, now);
|
|
|
|
this.sendMessage(script, larkCompanyTableInfo, logList,larkTableConfiguration,now);
|
|
|
|
this.sendMessage(script, larkCompanyTableInfo, logList, larkTableConfiguration, now);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
String script = LarkTableFilterScriptHelper.buildTimeRange(larkTableConfiguration, subType, RANGE_KEY, now);
|
|
|
|
String script = LarkTableFilterScriptHelper.buildTimeRange(larkTableConfiguration, subType, RANGE_KEY, now);
|
|
|
|
this.sendMessage(script, larkCompanyTableInfo, logList,larkTableConfiguration,now);
|
|
|
|
this.sendMessage(script, larkCompanyTableInfo, logList, larkTableConfiguration, now);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
@ -108,23 +107,27 @@ public class ScheduledRemindersTask {
|
|
|
|
log.info("scheduledRemindersTask end");
|
|
|
|
log.info("scheduledRemindersTask end");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void sendMessage(String script, LarkCompanyTableInfo larkCompanyTableInfo, List<EventLog> logList,LarkTableConfiguration larkTableConfiguration,LocalDateTime now) {
|
|
|
|
private void sendMessage(String script, LarkCompanyTableInfo larkCompanyTableInfo, List<EventLog> logList, LarkTableConfiguration larkTableConfiguration, LocalDateTime now) {
|
|
|
|
String pageToken = null;
|
|
|
|
String pageToken = null;
|
|
|
|
LarkTableRequest request = this.buildRequest(larkCompanyTableInfo, script);
|
|
|
|
LarkTableRequest request = this.buildRequest(larkCompanyTableInfo, script);
|
|
|
|
LarkTemplate template = this.getTemplate(larkCompanyTableInfo,larkTableConfiguration.getId());
|
|
|
|
LarkTemplate template = this.getTemplate(larkCompanyTableInfo, larkTableConfiguration.getId());
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
Object msg = new JSONObject();
|
|
|
|
Object msg = new JSONObject();
|
|
|
|
ListAppTableRecordRespBody respBody = larkTableHelper.listTableRecord(request);
|
|
|
|
ListAppTableRecordRespBody respBody = larkTableHelper.listTableRecord(request);
|
|
|
|
if (respBody.getPageToken().equals(pageToken)){
|
|
|
|
if (respBody.getPageToken().equals(pageToken)) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
pageToken = respBody.getPageToken();
|
|
|
|
pageToken = respBody.getPageToken();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (AppTableRecord item : respBody.getItems()) {
|
|
|
|
AppTableRecord[] items = respBody.getItems();
|
|
|
|
|
|
|
|
if (items == null || items.length == 0){
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (AppTableRecord item : items) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Map<String, Object> fields = item.getFields();
|
|
|
|
Map<String, Object> fields = item.getFields();
|
|
|
|
LocalDateTime localDateTime = changeLocalDateTime((Double) fields.get(RANGE_KEY));
|
|
|
|
LocalDateTime localDateTime = changeLocalDateTime((Double) fields.get(RANGE_KEY));
|
|
|
|
if ((localDateTime.getHour() == now.getHour() )&& localDateTime.getMinute() == now.getMinute()){
|
|
|
|
if ((localDateTime.getHour() == now.getHour()) && localDateTime.getMinute() == now.getMinute()) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
msg = this.buildMsg(larkCompanyTableInfo, fields, template);
|
|
|
|
msg = this.buildMsg(larkCompanyTableInfo, fields, template);
|
|
|
@ -138,7 +141,7 @@ public class ScheduledRemindersTask {
|
|
|
|
} while (StringUtils.isNotBlank(pageToken));
|
|
|
|
} while (StringUtils.isNotBlank(pageToken));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private LocalDateTime changeLocalDateTime(Double timestamp){
|
|
|
|
private LocalDateTime changeLocalDateTime(Double timestamp) {
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(timestamp.toString());
|
|
|
|
BigDecimal bigDecimal = new BigDecimal(timestamp.toString());
|
|
|
|
long time = bigDecimal.longValue();
|
|
|
|
long time = bigDecimal.longValue();
|
|
|
|
Instant instant = Instant.ofEpochMilli(time);
|
|
|
|
Instant instant = Instant.ofEpochMilli(time);
|
|
|
@ -146,7 +149,7 @@ public class ScheduledRemindersTask {
|
|
|
|
return LocalDateTime.ofInstant(instant, zone);
|
|
|
|
return LocalDateTime.ofInstant(instant, zone);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private LarkTemplate getTemplate(LarkCompanyTableInfo larkCompanyTableInfo,Long configurationId) {
|
|
|
|
private LarkTemplate getTemplate(LarkCompanyTableInfo larkCompanyTableInfo, Long configurationId) {
|
|
|
|
LarkTemplate larkTemplate = new LarkTemplate();
|
|
|
|
LarkTemplate larkTemplate = new LarkTemplate();
|
|
|
|
larkTemplate.setTemplateType(TemplateTypeEnum.SCHEDULED_REMINDER.getCode());
|
|
|
|
larkTemplate.setTemplateType(TemplateTypeEnum.SCHEDULED_REMINDER.getCode());
|
|
|
|
larkTemplate.setFlag(FlagStatus.OK.getCode());
|
|
|
|
larkTemplate.setFlag(FlagStatus.OK.getCode());
|
|
|
@ -180,27 +183,101 @@ public class ScheduledRemindersTask {
|
|
|
|
if (templateSubTypeEnum == null) {
|
|
|
|
if (templateSubTypeEnum == null) {
|
|
|
|
throw new RuntimeException(String.format("当前tableId:%s 模板类型%s对应策略不存在", larkCompanyTableInfo.getId(), template.getSubTemplateType()));
|
|
|
|
throw new RuntimeException(String.format("当前tableId:%s 模板类型%s对应策略不存在", larkCompanyTableInfo.getId(), template.getSubTemplateType()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LarkRobotRequest robotRequest = new LarkRobotRequest(larkCompanyTableInfo.getAppId(),larkCompanyTableInfo.getAppSecret());
|
|
|
|
LarkRobotRequest robotRequest = new LarkRobotRequest(larkCompanyTableInfo.getAppId(), larkCompanyTableInfo.getAppSecret());
|
|
|
|
switch (templateSubTypeEnum) {
|
|
|
|
|
|
|
|
case TEXT:
|
|
|
|
|
|
|
|
robotRequest.setMsgType(templateSubTypeEnum.getCode());
|
|
|
|
|
|
|
|
String templateContent = template.getTemplateContent();
|
|
|
|
String templateContent = template.getTemplateContent();
|
|
|
|
templateContent = templateContent.replaceAll("#name", String.valueOf(fields.get("学生姓名")));
|
|
|
|
robotRequest.setMsgType(templateSubTypeEnum.getCode());
|
|
|
|
JSONObject body = new JSONObject();
|
|
|
|
JSONObject record = new JSONObject(fields);
|
|
|
|
body.put("text",templateContent);
|
|
|
|
String body = this.buildTemplate(templateContent, record, larkCompanyTableInfo,larkCompanyTableInfo.getId());
|
|
|
|
robotRequest.setContent(body.toJSONString());
|
|
|
|
robotRequest.setContent(body);
|
|
|
|
List<LinkedTreeMap<String,String>> people = (List<LinkedTreeMap<String,String>>)fields.get("业务员");
|
|
|
|
List<LinkedTreeMap<String, String>> people = (List<LinkedTreeMap<String, String>>) fields.get("业务员");
|
|
|
|
for (int i = 0; i < people.size(); i++) {
|
|
|
|
for (int i = 0; i < people.size(); i++) {
|
|
|
|
LinkedTreeMap<String,String> detail = people.get(i);
|
|
|
|
LinkedTreeMap<String, String> detail = people.get(i);
|
|
|
|
robotRequest.setReceiveId(detail.get("id"));
|
|
|
|
robotRequest.setReceiveId(detail.get("id"));
|
|
|
|
msg = robotRequest;
|
|
|
|
msg = robotRequest;
|
|
|
|
larkRobotHelper.sendUserMessage(robotRequest);
|
|
|
|
larkRobotHelper.sendUserMessage(robotRequest);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
return msg;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String buildTemplate(String template, JSONObject record, LarkCompanyTableInfo request,Long tableRelationId) {
|
|
|
|
|
|
|
|
List<LarkTableRowRelation> rowRelationList = larkTableRowRelationMapper.queryListByTableRelationIdList(Arrays.asList(tableRelationId));
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(rowRelationList)){
|
|
|
|
|
|
|
|
return template;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (LarkTableRowRelation entry : rowRelationList) {
|
|
|
|
|
|
|
|
String msg = recursiveValue(record, entry.getFromId(), request);
|
|
|
|
|
|
|
|
template = template.replaceAll(entry.getToId(), msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return template;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 无前缀表示直接取值
|
|
|
|
|
|
|
|
* #前缀表示对象
|
|
|
|
|
|
|
|
* ##表示数组
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param record
|
|
|
|
|
|
|
|
* @param key
|
|
|
|
|
|
|
|
* @return
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private String recursiveValue(JSONObject record, String key, LarkCompanyTableInfo request) {
|
|
|
|
|
|
|
|
if (record == null) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String[] split = key.split(",");
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
|
|
|
for (index = 0; index < split.length; index++) {
|
|
|
|
|
|
|
|
String k = split[index].trim();
|
|
|
|
|
|
|
|
if (k.startsWith("##") && k.endsWith("${user}")) {
|
|
|
|
|
|
|
|
k = k.replace("##", "").replace("${user}", "");
|
|
|
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
|
|
JSONArray jsonArray = record.getJSONArray(k);
|
|
|
|
|
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
|
|
|
String openId = jsonArray.getString(i);
|
|
|
|
|
|
|
|
GetUserRespBody userInfoDetail = larkUserHelper.getUserInfoDetail(new LarkUserRequest(request.getAppId(), request.getAppSecret(), openId));
|
|
|
|
|
|
|
|
list.add(userInfoDetail.getUser().getName());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return String.join(",", list);
|
|
|
|
|
|
|
|
} else if (k.startsWith("##") && k.endsWith("${checkbox}")) {
|
|
|
|
|
|
|
|
k = k.replace("##", "").replace("${checkbox}", "");
|
|
|
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
|
|
JSONArray jsonArray = record.getJSONArray(k);
|
|
|
|
|
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
|
|
|
String param = jsonArray.getString(i);
|
|
|
|
|
|
|
|
list.add(param);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return String.join(",", list);
|
|
|
|
|
|
|
|
} else if (k.startsWith("##")) {
|
|
|
|
|
|
|
|
k = k.replace("##", "");
|
|
|
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
|
|
|
|
JSONArray jsonArray = record.getJSONArray(k);
|
|
|
|
|
|
|
|
for (int i = 0; i < jsonArray.size(); i++) {
|
|
|
|
|
|
|
|
Object object = jsonArray.get(i);
|
|
|
|
|
|
|
|
if (object instanceof String) {
|
|
|
|
|
|
|
|
list.add(String.valueOf(object));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
List<String> keyList = new ArrayList<>();
|
|
|
|
|
|
|
|
for (int j = index + 1; j < split.length; j++) {
|
|
|
|
|
|
|
|
keyList.add(split[j]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Object o = recursiveValue(jsonArray.getJSONObject(i), String.join(",", keyList), request);
|
|
|
|
|
|
|
|
list.add(String.valueOf(o));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return String.join(",", list);
|
|
|
|
|
|
|
|
} else if (k.startsWith("#")) {
|
|
|
|
|
|
|
|
k = k.replace("#", "");
|
|
|
|
|
|
|
|
record = record.getJSONObject(k);
|
|
|
|
|
|
|
|
} else if (k.endsWith("${time}")) {
|
|
|
|
|
|
|
|
String time = record.getString(k.replace("${time}", "").trim());
|
|
|
|
|
|
|
|
if (time.contains("T")) {
|
|
|
|
|
|
|
|
return time.replace("T", " ").substring(0, time.indexOf("+"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return msg;
|
|
|
|
}
|
|
|
|
|
|
|
|
return record.getString(split[index].trim());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<LarkCompanyTableInfo> getLarkList() {
|
|
|
|
private List<LarkCompanyTableInfo> getLarkList() {
|
|
|
@ -226,12 +303,12 @@ public class ScheduledRemindersTask {
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
String str = "[{avatar_url:https://s1-imfile.feishucdn.com/static-resource/v1/v2_5462d76b-2c9c-405f-8753-149c36bf097g~?image_size:72x72&cut_type:default-face&quality:&format:jpeg&sticker_format:.webp, email:, en_name:于相涌, id:ou_cd09481727e91fce1f12b7b0ed1500d2, name:于相涌}]";
|
|
|
|
String str = "[{avatar_url:https://s1-imfile.feishucdn.com/static-resource/v1/v2_5462d76b-2c9c-405f-8753-149c36bf097g~?image_size:72x72&cut_type:default-face&quality:&format:jpeg&sticker_format:.webp, email:, en_name:于相涌, id:ou_cd09481727e91fce1f12b7b0ed1500d2, name:于相涌}]";
|
|
|
|
str = str.replace("https:","https")
|
|
|
|
str = str.replace("https:", "https")
|
|
|
|
.replaceAll("\\{","{\"")
|
|
|
|
.replaceAll("\\{", "{\"")
|
|
|
|
.replaceAll(":","\":\"")
|
|
|
|
.replaceAll(":", "\":\"")
|
|
|
|
.replaceAll(",","\",\"")
|
|
|
|
.replaceAll(",", "\",\"")
|
|
|
|
.replaceAll("}","}")
|
|
|
|
.replaceAll("}", "}")
|
|
|
|
.replace("https","https:");
|
|
|
|
.replace("https", "https:");
|
|
|
|
JSONArray objects = JSONArray.parseArray(str);
|
|
|
|
JSONArray objects = JSONArray.parseArray(str);
|
|
|
|
int i = 0;
|
|
|
|
int i = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|