|
|
@ -59,7 +59,6 @@ import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
|
|
|
|
|
|
import static com.fr.design.dialog.FineJOptionPane.OPTION_OK_CANCEL; |
|
|
|
|
|
|
|
import static java.nio.charset.StandardCharsets.*; |
|
|
|
import static java.nio.charset.StandardCharsets.*; |
|
|
|
import static javax.swing.JOptionPane.QUESTION_MESSAGE; |
|
|
|
import static javax.swing.JOptionPane.QUESTION_MESSAGE; |
|
|
|
|
|
|
|
|
|
|
@ -475,19 +474,22 @@ public class UpdateMainDialog extends UIDialog { |
|
|
|
String readStr, updateTimeStr; |
|
|
|
String readStr, updateTimeStr; |
|
|
|
while ((readStr = br.readLine()) != null) { |
|
|
|
while ((readStr = br.readLine()) != null) { |
|
|
|
String[] updateInfo = readStr.split("\\t"); |
|
|
|
String[] updateInfo = readStr.split("\\t"); |
|
|
|
if (updateInfo.length == 2) { |
|
|
|
if (updateInfo.length == 3) { |
|
|
|
updateTimeStr = updateInfo[0]; |
|
|
|
updateTimeStr = updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]; |
|
|
|
Date updateTime = UPDATELOG_FORMAT.parse(updateTimeStr); |
|
|
|
Date updateTime = UPDATELOG_FORMAT.parse(updateTimeStr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//形如 Build#release-2018.07.31.03.03.52.80
|
|
|
|
//形如 Build#release-2018.07.31.03.03.52.80
|
|
|
|
String currentNO = GeneralUtils.readBuildNO(); |
|
|
|
String currentNO = GeneralUtils.readBuildNO(); |
|
|
|
Date curJarDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); |
|
|
|
Date curJarDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1)); |
|
|
|
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY)) { |
|
|
|
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY)) { |
|
|
|
if (!containsKeyword(UPDATE_INFO_TABLE_FORMAT.format(updateTime), keyword) && !containsKeyword(updateInfo[1], keyword)) { |
|
|
|
keyword.replace('.','-'); |
|
|
|
|
|
|
|
if (!containsKeyword(UPDATELOG_FORMAT.format(updateTime), keyword) && !containsKeyword(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], keyword)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (isValidLogInfo(updateInfo[1]) && curJarDate != null) { |
|
|
|
if (isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null) { |
|
|
|
updateInfoList.add(new Object[]{UPDATE_INFO_TABLE_FORMAT.format(updateTime), updateInfo[1], updateTime.after(curJarDate)}); |
|
|
|
updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -521,7 +523,7 @@ public class UpdateMainDialog extends UIDialog { |
|
|
|
try (BufferedWriter bufferWriter = new BufferedWriter(writerStream)) { |
|
|
|
try (BufferedWriter bufferWriter = new BufferedWriter(writerStream)) { |
|
|
|
for (int i = 0; i < jsonArray.length(); i++) { |
|
|
|
for (int i = 0; i < jsonArray.length(); i++) { |
|
|
|
JSONObject jo = (JSONObject) jsonArray.get(i); |
|
|
|
JSONObject jo = (JSONObject) jsonArray.get(i); |
|
|
|
bufferWriter.write((String) jo.get("updateTime") + '\t' + jo.get("jiraId") + " " + jo.get("info")); |
|
|
|
bufferWriter.write((String) jo.get("updateTime") + '\t' + jo.get("version") + '\t' + jo.get("jiraId") + " " + jo.get("info")); |
|
|
|
bufferWriter.newLine(); |
|
|
|
bufferWriter.newLine(); |
|
|
|
bufferWriter.flush(); |
|
|
|
bufferWriter.flush(); |
|
|
|
} |
|
|
|
} |
|
|
@ -546,13 +548,14 @@ public class UpdateMainDialog extends UIDialog { |
|
|
|
if (curJarDate == null) { |
|
|
|
if (curJarDate == null) { |
|
|
|
curJarDate = updateTime; |
|
|
|
curJarDate = updateTime; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY)) { |
|
|
|
if (!ComparatorUtils.equals(keyword, StringUtils.EMPTY) && keyword != null) { |
|
|
|
if (!containsKeyword(UPDATE_INFO_TABLE_FORMAT.format(updateTime), keyword) && !containsKeyword(updateTitle, keyword)) { |
|
|
|
keyword.replace('.', '-'); |
|
|
|
|
|
|
|
if (!containsKeyword(UPDATELOG_FORMAT.format(updateTime), keyword) && !containsKeyword(updateTitle, keyword)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (isValidLogInfo(updateTitle)) { |
|
|
|
if (isValidLogInfo(updateTitle)) { |
|
|
|
updateInfoList.add(new Object[]{UPDATE_INFO_TABLE_FORMAT.format(updateTime), updateVersionStr, updateTitle, updateTime.after(curJarDate)}); |
|
|
|
updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return new ArrayList<>(updateInfoList); |
|
|
|
return new ArrayList<>(updateInfoList); |
|
|
|