@@ -156,6 +156,9 @@ public void createImportTask(Long taskId, DmsImportTaskVO dmsImportTaskVO, Strin
156156 this .logDataTaskService .insert (new LogDataTaskDTO (taskId , "data import task start..." ));
157157 //get file
158158 String tmpFilePath = System .getProperty ("java.io.tmpdir" );
159+ if (!tmpFilePath .endsWith (File .separator )) {
160+ tmpFilePath += File .separator ;
161+ }
159162 tmpFilePath += "dms" + File .separator + "import" + File .separator + taskId ;
160163 FileUtil .mkdir (tmpFilePath );
161164 this .logDataTaskService .insert (new LogDataTaskDTO (taskId , StrUtil .format ("local temp file folder is {}" , tmpFilePath )));
@@ -207,6 +210,8 @@ public void createImportTask(Long taskId, DmsImportTaskVO dmsImportTaskVO, Strin
207210 this .logDataTaskService .insert (new LogDataTaskDTO (taskId , "data import completed." ));
208211 FileUtil .del (tmpFilePath );
209212 dmsDataTaskDTO .setTaskStatus (TaskStatus .SUCCESS .toDict ());
213+ } catch (Exception e ) {
214+ this .logDataTaskService .insert (new LogDataTaskDTO (taskId , StrUtil .format ("[{}] exception:{}" , e .getMessage ())));
210215 }
211216 } catch (Exception e ) {
212217 this .logDataTaskService .insert (new LogDataTaskDTO (taskId , StrUtil .format ("[{}] exception:{}" , e .getMessage ())));
@@ -223,6 +228,9 @@ public void createExportTask(Long taskId, String script) throws SQLException {
223228 dmsDataTaskDTO .setSqlScript (script );
224229 // 1. create local tmp folder
225230 String tmpFilePath = System .getProperty ("java.io.tmpdir" );
231+ if (!tmpFilePath .endsWith (File .separator )) {
232+ tmpFilePath += File .separator ;
233+ }
226234 tmpFilePath += "dms" + File .separator + "export" + File .separator + taskId ;
227235 FileUtil .mkdir (tmpFilePath );
228236 //2.set task status running
0 commit comments