浏览代码

导入开发

lwhhszx 2 年之前
父节点
当前提交
de4bc13ccf

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/common/core/CreateTaskThread.java

@@ -34,7 +34,7 @@ public class CreateTaskThread implements InitializingBean {
         List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().in(Task::getStatus, new ArrayList<>(Arrays.asList(0, 1))));
         List<Integer> taskIds = tasks.stream().map(Task::getId).collect(Collectors.toList());
         //将任务ids存入 taskQueueList
-        pantentQueueService.setTaskQueueList(taskIds);
+        pantentQueueService.queueAddTask(taskIds);
         //一个线程执行解析专利并入队列
         Thread thread1 = new Thread(() -> {
             pantentQueueService.addPatnetToQueue();

+ 10 - 10
PAS/src/main/java/cn/cslg/pas/common/utils/ReadExcelUtils.java

@@ -32,19 +32,19 @@ public class ReadExcelUtils {
     public static Integer textExcel(String filePath) throws IOException {
         //判断文件是否存在
         if (filePath == null || filePath.equals("")) {
-            //return -1;
-            ThrowException.throwXiaoShiException("文件上传失败,服务器忙请稍后再试!");
+            return -1;
+//            ThrowException.throwXiaoShiException("文件上传失败,服务器忙请稍后再试!");
         }
         File file = new File(filePath);
         if (!file.exists()) {
-            //return -1;
-            ThrowException.throwXiaoShiException("文件上传失败,服务器忙请稍后再试!");
+            return -1;
+//            ThrowException.throwXiaoShiException("文件上传失败,服务器忙请稍后再试!");
         }
 
         // 检测是否为excel文件
         if (!filePath.endsWith(".xls") && !filePath.endsWith(".xlsx") && !filePath.endsWith(".XLS") && !filePath.endsWith(".XLSX")) {
-            //return -1;
-            ThrowException.throwXiaoShiException("请上传Excel文件!");
+            return -1;
+//            ThrowException.throwXiaoShiException("请上传Excel文件!");
         }
 
         InputStream fis = new FileInputStream(file);
@@ -61,14 +61,14 @@ public class ReadExcelUtils {
         //读取总行数
         int rows = sheet.getPhysicalNumberOfRows();
         if (rows <= 0) {
-            //return -2;
-            ThrowException.throwXiaoShiException("文件内容格式不正确!");
+            return -2;
+//            ThrowException.throwXiaoShiException("文件内容格式不正确!");
         }
 
         Row firstRow = sheet.getRow(0);
         if (!firstRow.getCell(0).getStringCellValue().equals("公开(公告)号")) {
-            //return -2;
-            ThrowException.throwXiaoShiException("文件内容格式不正确!");
+            return -2;
+//            ThrowException.throwXiaoShiException("文件内容格式不正确!");
         }
 
         //返回文件总行数-1(即专利总数量)

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/PantentQueueService.java

@@ -107,7 +107,7 @@ public class PantentQueueService {
 
         }
     }
-    public void setTaskQueueList(List<Integer> taskQueueList) {
+    public void queueAddTask(List<Integer> taskQueueList) {
         this.taskQueueList.addAll(taskQueueList);
     }
     public void awakeTasktch(){

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/UploadTaskService.java

@@ -44,7 +44,7 @@ public class UploadTaskService {
         Integer total = ReadExcelUtils.textExcel(filePath);
         //新增任务(专利导入导出任务表)
       Integer taskId =  taskService.add(fileDTO, projectImportPatentVO.getProjectId(), null, total, 1, 0, file.getOriginalFilename());
-       pantentQueueService.setTaskQueueList(Arrays.asList(taskId));
+       pantentQueueService.queueAddTask(Arrays.asList(taskId));
        pantentQueueService.awakeTasktch();
     }