Bladeren bron

CSV格式文件导入,与回调5

zhaoxian 1 jaar geleden
bovenliggende
commit
54f18dc26a

+ 19 - 13
jeecg-boot-module-system/src/main/java/cn/com/ctop/toutiao/modules/material/controller/FirstDeliveryValidController.java

@@ -60,19 +60,25 @@ public class FirstDeliveryValidController {
         String key = nowDate + "_importExcelMaterials";
         Object creative = redisUtil.get(key);
         if (Check.isNull(creative)) {
-            try {
-                redisUtil.set(key, "NO");
-                StringBuffer path = new StringBuffer();
-                path.append(downloadPath).append("excel").append("/").append(DateUtils.formatDate()).append("/");
-                String newFileUrl = FileUtil.approvalFile(file, path.toString());
-                //宇鹏本地服务
-//            HttpUtils.fileUpload("http://192.168.1.149:8765/webhook/get_file", newFileUrl, null);
-                //宇鹏外网服务
-                HttpUtils.fileUpload("http://111.204.208.194:9998/webhook/get_file", newFileUrl, null);
-            } catch (Exception e) {
-                e.printStackTrace();
-                redisUtil.removeAll(key);
-            }
+            redisUtil.set(key, "NO");
+            Thread thread = new Thread() {
+                @Override
+                public void run() {
+                    try {
+                        StringBuffer path = new StringBuffer();
+                        path.append(downloadPath).append("excel").append("/").append(DateUtils.formatDate()).append("/");
+                        String newFileUrl = FileUtil.approvalFile(file, path.toString());
+                        //宇鹏本地服务
+//                        HttpUtils.fileUpload("http://192.168.1.149:8765/webhook/get_file", newFileUrl, null);
+                        //宇鹏外网服务
+                        HttpUtils.fileUpload("http://111.204.208.194:9998/webhook/get_file", newFileUrl, null);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                        redisUtil.removeAll(key);
+                    }
+                }
+            };
+            thread.start();
         } else {
             return Result.error("文件上传中...");
         }