chendayu 2 lat temu
rodzic
commit
209ddf03ad

+ 0 - 1
PAS/src/main/java/cn/cslg/pas/service/TaskService.java

@@ -321,7 +321,6 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> implements ITaskS
             for (QueryTaskVO task : tasks) {
                 if (task.getType().equals(3) || task.getType().equals(4)) {
                     String conditions = task.getConditions();
-                    conditions = conditions.substring(conditions.indexOf("(") + 1, conditions.lastIndexOf(")"));
                     String createTime = new SimpleDateFormat("yyyyMMdd").format(task.getCreateTime());
                     String taskName = createTime + " - 检索式:" + conditions + " - " + task.getCreateName();
                     task.setTaskName(taskName);

+ 35 - 30
PAS/src/main/java/cn/cslg/pas/service/getPatentStarPart/GetPatentStarPartService.java

@@ -71,7 +71,7 @@ public class GetPatentStarPartService {
      * @param appNo 申请号
      * @return 返回装载着权要的对象
      */
-    public PatentDTO getParentRight(String appNo) {
+    public PatentDTO getParentRight(String appNo) throws IOException {
         StarPatentVO starPatentVO = new StarPatentVO()
                 .setApplicationNo(appNo);
         UploadParamsVO uploadParamsVO = new UploadParamsVO();
@@ -92,7 +92,7 @@ public class GetPatentStarPartService {
      * @param appNo 申请号
      * @return 返回装载着说明书文本的对象
      */
-    public PatentDTO getInstructionText(String appNo) {
+    public PatentDTO getInstructionText(String appNo) throws IOException {
         StarPatentVO starPatentVO = new StarPatentVO()
                 .setApplicationNo(appNo);
         UploadParamsVO uploadParamsVO = new UploadParamsVO();
@@ -234,41 +234,46 @@ public class GetPatentStarPartService {
     }
 
     public PatentDTO getAffair(String appNo) throws IOException {
+        PatentDTO patentDTO = new PatentDTO();
+
         if (appNo.contains(".")) {
             appNo = appNo.substring(0, appNo.lastIndexOf("."));
         }
         //以下 ↓装载的是调用"获得中国专利法律状态"接口返回的专利相关数据
         String cnLegalApiStr = patentStarApiService.getCnLegalApi(appNo);
-        List<ChinaLeagalStatus> chinaLeagalStatuses = JSON.parseArray(cnLegalApiStr, ChinaLeagalStatus.class);
-        ArrayList<KeyValueVO> lst = new ArrayList<>();
-        HashMap<Integer, String> nameMap = new HashMap<>();
-        HashMap<Integer, String> contentMap = new HashMap<>();
-        nameMap.put(0, "发生日期");
-        nameMap.put(1, "法律状态");
-        nameMap.put(2, "详细法律状态");
-        nameMap.put(3, "详细信息");
-        for (ChinaLeagalStatus chinaLeagalStatus : chinaLeagalStatuses) {
-            contentMap.put(0, chinaLeagalStatus.getLegalDate());
-            contentMap.put(1, chinaLeagalStatus.getLegalStatus());
-            contentMap.put(2, chinaLeagalStatus.getLegalStatusInfo());
-            contentMap.put(3, chinaLeagalStatus.getDETAIL());
-            ArrayList<KeyValueVO.InpadocData> inpadocDatas = new ArrayList<>();
-            for (int i = 0; i < 4; i++) {
-                KeyValueVO.InpadocData inpadocData = new KeyValueVO.InpadocData();
-                inpadocData.setName(nameMap.get(i));
-                inpadocData.setContent(contentMap.get(i));
-                inpadocDatas.add(inpadocData);
+        if (!cnLegalApiStr.equals("")) {
+            List<ChinaLeagalStatus> chinaLeagalStatuses = JSON.parseArray(cnLegalApiStr, ChinaLeagalStatus.class);
+            if (chinaLeagalStatuses != null && chinaLeagalStatuses.size() > 0) {
+                ArrayList<KeyValueVO> lst = new ArrayList<>();
+                HashMap<Integer, String> nameMap = new HashMap<>();
+                HashMap<Integer, String> contentMap = new HashMap<>();
+                nameMap.put(0, "发生日期");
+                nameMap.put(1, "法律状态");
+                nameMap.put(2, "详细法律状态");
+                nameMap.put(3, "详细信息");
+                for (ChinaLeagalStatus chinaLeagalStatus : chinaLeagalStatuses) {
+                    contentMap.put(0, chinaLeagalStatus.getLegalDate());
+                    contentMap.put(1, chinaLeagalStatus.getLegalStatus());
+                    contentMap.put(2, chinaLeagalStatus.getLegalStatusInfo());
+                    contentMap.put(3, chinaLeagalStatus.getDETAIL());
+                    ArrayList<KeyValueVO.InpadocData> inpadocDatas = new ArrayList<>();
+                    for (int i = 0; i < 4; i++) {
+                        KeyValueVO.InpadocData inpadocData = new KeyValueVO.InpadocData();
+                        inpadocData.setName(nameMap.get(i));
+                        inpadocData.setContent(contentMap.get(i));
+                        inpadocDatas.add(inpadocData);
+                    }
+                    KeyValueVO keyValueVO = new KeyValueVO();
+                    keyValueVO.setInpadocData(inpadocDatas);
+                    lst.add(keyValueVO);
+                }
+                ArrayList<PatentAffair> patentAffairs = new ArrayList<>();
+                PatentAffair patentAffair = new PatentAffair();
+                patentAffair.setInpadoc(lst);
+                patentAffairs.add(patentAffair);
+                patentDTO.setAffair(patentAffairs);
             }
-            KeyValueVO keyValueVO = new KeyValueVO();
-            keyValueVO.setInpadocData(inpadocDatas);
-            lst.add(keyValueVO);
         }
-        PatentDTO patentDTO = new PatentDTO();
-        ArrayList<PatentAffair> patentAffairs = new ArrayList<>();
-        PatentAffair patentAffair = new PatentAffair();
-        patentAffair.setInpadoc(lst);
-        patentAffairs.add(patentAffair);
-        patentDTO.setAffair(patentAffairs);
         return patentDTO;
     }
 

+ 1 - 1
PAS/src/main/java/cn/cslg/pas/service/outApi/PatentStarApiService.java

@@ -344,7 +344,7 @@ public class PatentStarApiService {
 
     public List<PatentStarListDto> getSplitedConditions(PatentStarListDto patentStarListDto, int patentNum) throws IOException {
         DateTime nowDate = new DateTime();
-        DateTime date = DateUtils2.formStrToDateTime("2000-01-01");
+        DateTime date = DateUtils2.formStrToDateTime("1900-01-01");
         //超过1万的列表
         List<PatentStarListDto> patentStarListDtos = new ArrayList<>();
         //返回的列表

+ 145 - 166
PAS/src/main/java/cn/cslg/pas/service/upLoadPatent/ExcutePatentDataStar.java

@@ -26,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
 import java.io.*;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -61,7 +62,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
     public void startExcute(Task task) throws IOException {
 
         //若本次下载任务是超过一万条专利的全部下载任务
-        int patentNum = 300;
+        int patentNum = 10000;
         if (task.getEndNumber() > patentNum) {
             try {
                 Integer total = task.getTotal();  //任务专利总数量
@@ -91,6 +92,7 @@ public class ExcutePatentDataStar implements IExcutePatentData {
                         continue;
                     }
 
+
                     //至此,即找到了当前检索式即为要下载的专利开始位置所属的检索式,重新计算开始位置startNumber(即要下载的专利的开始位置,对应了当前检索式中该专利位置)
                     startNumber = startNumber - (countForStart - patentStarListDto.getTotal());
                     //第一个检索式下载完成后,从第二个检索式开始 startNumber都是从1开始下载
@@ -470,41 +472,42 @@ public class ExcutePatentDataStar implements IExcutePatentData {
         //以下 ↓装载的是调用"获得中国专利法律状态"接口返回的专利相关数据
         PatentAffair patentAffair = new PatentAffair();
         String cnLegalApiStr = patentStarApiService.getCnLegalApi(appNo);
-        List<ChinaLeagalStatus> chinaLeagalStatuses = JSON.parseArray(cnLegalApiStr, ChinaLeagalStatus.class);
-        if (chinaLeagalStatuses != null && chinaLeagalStatuses.size() > 0) {
-            ArrayList<KeyValueVO> lst = new ArrayList<>();
-            HashMap<Integer, String> nameMap = new HashMap<>();
-            HashMap<Integer, String> contentMap = new HashMap<>();
-            nameMap.put(0, "发生日期");
-            nameMap.put(1, "法律状态");
-            nameMap.put(2, "详细法律状态");
-            nameMap.put(3, "详细信息");
-            for (int i = 0; i < chinaLeagalStatuses.size(); i++) {
-                if (i == 0) {
-                    patentAffair.setStatus(chinaLeagalStatuses.get(i).getLegalStatus());
-                }
-                contentMap.put(0, chinaLeagalStatuses.get(i).getLegalDate());
-                contentMap.put(1, chinaLeagalStatuses.get(i).getLegalStatus());
-                contentMap.put(2, chinaLeagalStatuses.get(i).getLegalStatusInfo());
-                contentMap.put(3, chinaLeagalStatuses.get(i).getDETAIL());
-                ArrayList<KeyValueVO.InpadocData> inpadocDatas = new ArrayList<>();
-                for (int j = 0; j < 4; j++) {
-                    KeyValueVO.InpadocData inpadocData = new KeyValueVO.InpadocData();
-                    inpadocData.setName(nameMap.get(j));
-                    inpadocData.setContent(contentMap.get(j));
-                    inpadocDatas.add(inpadocData);
+        if (!cnLegalApiStr.equals("")) {
+            List<ChinaLeagalStatus> chinaLeagalStatuses = JSON.parseArray(cnLegalApiStr, ChinaLeagalStatus.class);
+            if (chinaLeagalStatuses != null && chinaLeagalStatuses.size() > 0) {
+                ArrayList<KeyValueVO> lst = new ArrayList<>();
+                HashMap<Integer, String> nameMap = new HashMap<>();
+                HashMap<Integer, String> contentMap = new HashMap<>();
+                nameMap.put(0, "发生日期");
+                nameMap.put(1, "法律状态");
+                nameMap.put(2, "详细法律状态");
+                nameMap.put(3, "详细信息");
+                for (int i = 0; i < chinaLeagalStatuses.size(); i++) {
+                    if (i == 0) {
+                        patentAffair.setStatus(chinaLeagalStatuses.get(i).getLegalStatus());
+                    }
+                    contentMap.put(0, chinaLeagalStatuses.get(i).getLegalDate());
+                    contentMap.put(1, chinaLeagalStatuses.get(i).getLegalStatus());
+                    contentMap.put(2, chinaLeagalStatuses.get(i).getLegalStatusInfo());
+                    contentMap.put(3, chinaLeagalStatuses.get(i).getDETAIL());
+                    ArrayList<KeyValueVO.InpadocData> inpadocDatas = new ArrayList<>();
+                    for (int j = 0; j < 4; j++) {
+                        KeyValueVO.InpadocData inpadocData = new KeyValueVO.InpadocData();
+                        inpadocData.setName(nameMap.get(j));
+                        inpadocData.setContent(contentMap.get(j));
+                        inpadocDatas.add(inpadocData);
+                    }
+                    KeyValueVO keyValueVO = new KeyValueVO();
+                    keyValueVO.setInpadocData(inpadocDatas);
+                    lst.add(keyValueVO);
                 }
-                KeyValueVO keyValueVO = new KeyValueVO();
-                keyValueVO.setInpadocData(inpadocDatas);
-                lst.add(keyValueVO);
+                //装载事务表的status(公开|授权|驳回|权力转移。。。)
+                String content = JSONObject.toJSONString(lst);
+                patentAffair.setContent(content);
+                uploadParamsVO.setPatentAffair(patentAffair);
             }
-            //装载事务表的status(公开|授权|驳回|权力转移。。。)
-            String content = JSONObject.toJSONString(lst);
-            patentAffair.setContent(content);
-            uploadParamsVO.setPatentAffair(patentAffair);
         }
 
-
     }
 
     /**
@@ -513,42 +516,37 @@ public class ExcutePatentDataStar implements IExcutePatentData {
      * @param starPatent     专利之星著录对象
      * @param uploadParamsVO 专利实体类对象
      */
-    public void setPatentClaim(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) {
-        try {
-            String appNo;
-            if (starPatent.getApplicationNo().contains(".")) {
-                appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
-            } else {
-                appNo = starPatent.getApplicationNo();
-            }
-            //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
-            String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
-
-            //使用正则表达式拼接出权要原文
-            String regex = "(?<=<claim id=.{1,110}>)[\\w\\W]+?(?=</claim>)";
-            Pattern compile = Pattern.compile(regex);
-            Matcher matcher = compile.matcher(cnFullXmlStr);
-            StringBuilder builder = new StringBuilder();
-            while (matcher.find()) {
-                String macherGroup = matcher.group();
-                String right = macherGroup.replaceAll("<.*?>", "").trim();
-                builder.append(right).append("\r\n");
-            }
+    public void setPatentClaim(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
+        String appNo;
+        if (starPatent.getApplicationNo().contains(".")) {
+            appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
+        } else {
+            appNo = starPatent.getApplicationNo();
+        }
+        //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
+        String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
+
+        //使用正则表达式拼接出权要原文
+        String regex = "(?<=<claim id=.{1,110}>)[\\w\\W]+?(?=</claim>)";
+        Pattern compile = Pattern.compile(regex);
+        Matcher matcher = compile.matcher(cnFullXmlStr);
+        StringBuilder builder = new StringBuilder();
+        while (matcher.find()) {
+            String macherGroup = matcher.group();
+            String right = macherGroup.replaceAll("<.*?>", "").trim();
+            builder.append(right).append("\r\n");
+        }
 
-            String patentRightText = builder + "";
+        String patentRightText = builder + "";
 
-            //使用工具类去除字符串文本中的所有HTML格式标签
-            patentRightText = RemoveHtmlTagsUtils.removeHtmlTags(patentRightText);
-            patentRightText = patentRightText.trim();
+        //使用工具类去除字符串文本中的所有HTML格式标签
+        patentRightText = RemoveHtmlTagsUtils.removeHtmlTags(patentRightText);
+        patentRightText = patentRightText.trim();
 
-            //装载权利要求原文
-            PatentRight patentRight = new PatentRight();
-            patentRight.setContent(patentRightText);
-            uploadParamsVO.setPatentRight(patentRight);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        //装载权利要求原文
+        PatentRight patentRight = new PatentRight();
+        patentRight.setContent(patentRightText);
+        uploadParamsVO.setPatentRight(patentRight);
 
     }
 
@@ -558,120 +556,64 @@ public class ExcutePatentDataStar implements IExcutePatentData {
      * @param starPatent     专利之星著录对象
      * @param uploadParamsVO 专利实体类对象
      */
-    public void setPatentInstructionText(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) {
-        try {
-            String appNo;
-            if (starPatent.getApplicationNo().contains(".")) {
-                appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
+    public void setPatentInstructionText(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
+        String appNo;
+        if (starPatent.getApplicationNo().contains(".")) {
+            appNo = starPatent.getApplicationNo().substring(0, starPatent.getApplicationNo().lastIndexOf("."));
+        } else {
+            appNo = starPatent.getApplicationNo();
+        }
+        //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
+        String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
+
+        //使用正则表达式拼接出说明书文本全文
+        String regex = "(?<=<p id=\"p)[\\w\\W]+?(?=</p>)";
+        Pattern compile = Pattern.compile(regex);
+        Matcher matcher = compile.matcher(cnFullXmlStr);
+        StringBuilder builder = new StringBuilder();
+        while (matcher.find()) {
+            String oldRow = matcher.group();
+            if (oldRow.contains("num=\"n")) {
+                oldRow = oldRow.substring(oldRow.indexOf("num=\"n") + 6);
+                oldRow = "[" + oldRow;
+                oldRow = oldRow.replace("\">", "]");
+            } else if (oldRow.contains("num=")) {
+                oldRow = oldRow.substring(oldRow.indexOf("num=") + 5);
+                oldRow = "[" + oldRow;
+                oldRow = oldRow.replace("\">", "]");
             } else {
-                appNo = starPatent.getApplicationNo();
+                oldRow = oldRow.substring(oldRow.indexOf("\">") + 2);
             }
-            //根据申请号调用"获得中国专利全文文本"接口,获得包含各种xml标签的专利全文内容的长字符串 cnFullXmlStr
-            String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(appNo);
-
-            //使用正则表达式拼接出说明书文本全文
-            String regex = "(?<=<p id=\"p)[\\w\\W]+?(?=</p>)";
-            Pattern compile = Pattern.compile(regex);
-            Matcher matcher = compile.matcher(cnFullXmlStr);
-            StringBuilder builder = new StringBuilder();
-            while (matcher.find()) {
-                String oldRow = matcher.group();
-                if (oldRow.contains("num=\"n")) {
-                    oldRow = oldRow.substring(oldRow.indexOf("num=\"n") + 6);
-                    oldRow = "[" + oldRow;
-                    oldRow = oldRow.replace("\">", "]");
-                } else if (oldRow.contains("num=")) {
-                    oldRow = oldRow.substring(oldRow.indexOf("num=") + 5);
-                    oldRow = "[" + oldRow;
-                    oldRow = oldRow.replace("\">", "]");
-                } else {
-                    oldRow = oldRow.substring(oldRow.indexOf("\">") + 2);
-                }
-                builder.append(oldRow).append("\r\n");
-            }
-
-            String instructionText = builder + "";
-
-            //使用工具类去除字符串文本中的所有HTML格式标签
-            instructionText = RemoveHtmlTagsUtils.removeHtmlTags(instructionText);
-            instructionText = instructionText.trim();
-
-            //装载说明书文本全文
-            PatentInstructionText patentInstructionText = new PatentInstructionText();
-            patentInstructionText.setManual(instructionText);
-            uploadParamsVO.setPatentInstructionText(patentInstructionText);
-
-        } catch (Exception e) {
-            e.printStackTrace();
+            builder.append(oldRow).append("\r\n");
         }
 
-    }
+        String instructionText = builder + "";
 
-    /**
-     * 装载说明书pdf
-     *
-     * @param starPatent     专利之星著录对象
-     * @param uploadParamsVO 专利实体类对象
-     */
-    public void setPatentInstructionPDF(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) {
-        try {
-            //根据专利号调用"获得世界专利pdf"接口,获得pdf的url地址
-            if (starPatent.getPatentNo() != null && !starPatent.getPatentNo().equals("")) {
-                String pdfUrl = patentStarApiService.getEnPdfApi(starPatent.getPatentNo());
-                URL url = new URL(pdfUrl);  //想要读取的url地址
-                InputStream in = url.openStream();
-
-                File file = File.createTempFile("new_url", ".pdf");  //创建文件
-                OutputStream os = new FileOutputStream(file);  //创建文件输出流
-                int bytesRead;
-                byte[] buffer = new byte[8192];
-                int len = 8192;
-                while ((bytesRead = in.read(buffer, 0, len)) != -1) {
-                    os.write(buffer, 0, bytesRead);
-                }
-                //关闭释放流
-                os.close();
-                in.close();
-
-                DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(16, null);
-                FileItem item = diskFileItemFactory.createItem(file.getName(), "text/plain", true, file.getName());
-                buffer = new byte[8192];
-                FileInputStream fis = new FileInputStream(file);
-                OutputStream fos = item.getOutputStream();
-                len = 8192;
-                while ((bytesRead = fis.read(buffer, 0, len)) != -1) {
-                    fos.write(buffer, 0, bytesRead);
-                }
-                //关闭释放流
-                fos.close();
-                fis.close();
-                MultipartFile multipartFile = new CommonsMultipartFile(item);
-                UploadFileDTO fileDTO = fileUtils.uploadFile(multipartFile);
-                uploadParamsVO.setFileDTO(fileDTO);
+        //使用工具类去除字符串文本中的所有HTML格式标签
+        instructionText = RemoveHtmlTagsUtils.removeHtmlTags(instructionText);
+        instructionText = instructionText.trim();
 
-            }
-
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        //装载说明书文本全文
+        PatentInstructionText patentInstructionText = new PatentInstructionText();
+        patentInstructionText.setManual(instructionText);
+        uploadParamsVO.setPatentInstructionText(patentInstructionText);
 
     }
 
     /**
-     * 装载摘要附图
+     * 装载说明书pdf
      *
      * @param starPatent     专利之星著录对象
      * @param uploadParamsVO 专利实体类对象
      */
-    public void setPatentPicture(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) {
-        //取出一般接口返回的摘要附图路径
-        String pictureUrl = starPatent.getAbstractPath();
-
-        try {
-            URL url = new URL(pictureUrl);  //想要读取的url地址
+    public void setPatentInstructionPDF(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
+        //根据专利号调用"获得世界专利pdf"接口,获得pdf的url地址
+        if (starPatent.getPatentNo() != null && !starPatent.getPatentNo().equals("")) {
+            String pdfUrl = patentStarApiService.getEnPdfApi(starPatent.getPatentNo());
+            URL url = new URL(pdfUrl);  //想要读取的url地址
             InputStream in = url.openStream();
 
-            File file = File.createTempFile("new_url", ".jpg");  //创建文件
+            File file = File.createTempFile("new_url", ".pdf");  //创建文件
             OutputStream os = new FileOutputStream(file);  //创建文件输出流
             int bytesRead;
             byte[] buffer = new byte[8192];
@@ -699,14 +641,51 @@ public class ExcutePatentDataStar implements IExcutePatentData {
             UploadFileDTO fileDTO = fileUtils.uploadFile(multipartFile);
             uploadParamsVO.setFileDTO(fileDTO);
 
-
-        } catch (Exception e) {
-            e.printStackTrace();
         }
 
     }
 
     /**
+     * 装载摘要附图
+     *
+     * @param starPatent     专利之星著录对象
+     * @param uploadParamsVO 专利实体类对象
+     */
+    public void setPatentPicture(StarPatentVO starPatent, UploadParamsVO uploadParamsVO) throws IOException {
+        //取出一般接口返回的摘要附图路径
+        String pictureUrl = starPatent.getAbstractPath();
+        URL url = new URL(pictureUrl);  //想要读取的url地址
+        InputStream in = url.openStream();
+        File file = File.createTempFile("new_url", ".jpg");  //创建文件
+        OutputStream os = new FileOutputStream(file);  //创建文件输出流
+        int bytesRead;
+        byte[] buffer = new byte[8192];
+        int len = 8192;
+        while ((bytesRead = in.read(buffer, 0, len)) != -1) {
+            os.write(buffer, 0, bytesRead);
+        }
+        //关闭释放流
+        os.close();
+        in.close();
+
+        DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory(16, null);
+        FileItem item = diskFileItemFactory.createItem(file.getName(), "text/plain", true, file.getName());
+        buffer = new byte[8192];
+        FileInputStream fis = new FileInputStream(file);
+        OutputStream fos = item.getOutputStream();
+        len = 8192;
+        while ((bytesRead = fis.read(buffer, 0, len)) != -1) {
+            fos.write(buffer, 0, bytesRead);
+        }
+        //关闭释放流
+        fos.close();
+        fis.close();
+        MultipartFile multipartFile = new CommonsMultipartFile(item);
+        UploadFileDTO fileDTO = fileUtils.uploadFile(multipartFile);
+        uploadParamsVO.setFileDTO(fileDTO);
+
+    }
+    /**
      * 下载指定多个专利号专利
      *
      * @param isAddPatentNos 起止条数以外,用户手动勾选的多个专利号

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

@@ -561,7 +561,6 @@ public class PantentQueueService {
             } else if (num != null && num < needNum) {
                 patentIdMap.put(currentPatent, ++num);
             } else {  //表示当前这个任务这个专利的消费者全都消费结束
-
                 //若任务状态是等待中(即该任务的第一个专利消费完时), 将状态置为进行中
                 if (task.getStatus() == 0) {
                     task.setStatus(1);
@@ -569,18 +568,15 @@ public class PantentQueueService {
                     taskService.updateById(task);
                 }
                 patentIdMap.remove(currentPatent);
-
                 //任务表更新 完成条数+1
                 task.setSuccessNum(task.getSuccessNum() + 1);
                 Task updateTask = new Task();
                 updateTask.setId(task.getId());
                 updateTask.setDefaultNum(questionRecordMapper.selectDefaultNum(task.getId()));
-                updateTask.setTrueSuccessNum(task.getSuccessNum() - task.getDefaultNum());
+                updateTask.setTrueSuccessNum(task.getSuccessNum() - updateTask.getDefaultNum());
                 updateTask.setSuccessNum(task.getSuccessNum());
                 taskService.updateById(updateTask);
-
                 long percentage = (long) Math.floor((task.getSuccessNum() + 0D) / total * 100D);
-
                 //当全部完成时
                 if (task.getSuccessNum().equals(total)) {
                     percentage = 100L;