|
@@ -121,9 +121,10 @@ public class TaskExportCommon {
|
|
*
|
|
*
|
|
* @param path
|
|
* @param path
|
|
* @param txtStr
|
|
* @param txtStr
|
|
|
|
+ * @param excelFile
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- public void writeExportResultTxt(String path, String txtStr) throws IOException {
|
|
|
|
|
|
+ public void writeExportResultTxt(String path, String txtStr, File excelFile) throws IOException {
|
|
FileWriter fileWriter = null;
|
|
FileWriter fileWriter = null;
|
|
try {
|
|
try {
|
|
File file = new File(path + File.separator + String.valueOf(UUID.randomUUID()).replaceAll("-", "") + SystemConstant.TXT_PREFIX);
|
|
File file = new File(path + File.separator + String.valueOf(UUID.randomUUID()).replaceAll("-", "") + SystemConstant.TXT_PREFIX);
|
|
@@ -136,10 +137,12 @@ public class TaskExportCommon {
|
|
JSONObject json = new JSONObject();
|
|
JSONObject json = new JSONObject();
|
|
json.put("path", file.getPath().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
|
|
json.put("path", file.getPath().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
|
|
json.put("type", this.type);
|
|
json.put("type", this.type);
|
|
- if (this.exception) {
|
|
|
|
- this.tbTaskHistory.setErrorFilePath(json.toJSONString());
|
|
|
|
- } else {
|
|
|
|
- this.tbTaskHistory.setResultFilePath(json.toJSONString());
|
|
|
|
|
|
+ this.tbTaskHistory.setReportFilePath(json.toJSONString());
|
|
|
|
+ if (Objects.nonNull(excelFile)) {
|
|
|
|
+ JSONObject excelJson = new JSONObject();
|
|
|
|
+ excelJson.put("path", excelFile.getPath().replaceAll(SystemConstant.FILES_DIR + File.separator, ""));
|
|
|
|
+ excelJson.put("type", this.type);
|
|
|
|
+ this.tbTaskHistory.setResultFilePath(excelJson.toJSONString());
|
|
}
|
|
}
|
|
if (Objects.equals(this.type, SystemConstant.OSS)) {
|
|
if (Objects.equals(this.type, SystemConstant.OSS)) {
|
|
this.ossUtil.ossUpload(this.ossEnv, file.getPath(), txtStr);
|
|
this.ossUtil.ossUpload(this.ossEnv, file.getPath(), txtStr);
|