|
@@ -1,5 +1,8 @@
|
|
|
package cn.cslg.pas.service.importPatent;
|
|
|
|
|
|
+import cn.cslg.pas.common.dto.PatentStarListDTO;
|
|
|
+import cn.cslg.pas.common.model.cronModel.Calculate;
|
|
|
+import cn.cslg.pas.common.utils.DateUtils;
|
|
|
import cn.cslg.pas.common.utils.MathUtils;
|
|
|
import cn.cslg.pas.common.utils.ThrowException;
|
|
|
import cn.cslg.pas.common.vo.ImportTaskAMVO;
|
|
@@ -167,78 +170,35 @@ public class ImportFromWebToEsService implements PatentImportImp {
|
|
|
String imContents = MathUtils.fun(2, importContent);
|
|
|
//下载字段
|
|
|
char[] importCells = imContents.toCharArray();
|
|
|
+ Calculate calculate = DateUtils.calculateFromStartAndEndNumber(doneNum, importTaskAMVO.getAllNum(),50);
|
|
|
+ Integer startPage = calculate.getStartPage();
|
|
|
+ Integer startNum = calculate.getStartNum();
|
|
|
+ Integer endPage = calculate.getEndPage();
|
|
|
|
|
|
|
|
|
-//
|
|
|
-// //根据计算出的起止页数,一页一页检索
|
|
|
-// for (int i = startPage; i <= endPage; i++) {
|
|
|
-// PatentStarListDto patentStarListDto = new PatentStarListDto()
|
|
|
-// .setCurrentQuery(conditions)
|
|
|
-// .setOrderBy(orderBy)
|
|
|
-// .setOrderByType(orderByType)
|
|
|
-// .setPageNum(i)
|
|
|
-// .setRowCount(50)
|
|
|
-// .setDBType(dbType);
|
|
|
-// //调用一般接口返回一批专利著录相关数据
|
|
|
-// Map<String, Object> resultMap = patentStarApiService.patentStarSearchApi(patentStarListDto);
|
|
|
-// if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
|
-// ThrowException.throwXiaoShiException("未检索到相关专利");
|
|
|
-// }
|
|
|
-//
|
|
|
-// List<StarPatentVO> starPatents = (List<StarPatentVO>) resultMap.get("records");
|
|
|
-// //遍历这一页的专利
|
|
|
-// for (int j = 0; j < starPatents.size(); j++) {
|
|
|
-// //若任务状态为已暂停,则结束生产
|
|
|
-//// if (pTaskId.equals(task.getId()) && pTaskStatus == 4) {
|
|
|
-//// return;
|
|
|
-//// }
|
|
|
-// //若还没到开始页的开始位置,则跳过,不下载它
|
|
|
-//// if (i == startPage && j < startNum - 1) {
|
|
|
-//// continue;
|
|
|
-//// }
|
|
|
-//// //若到了结束页的结束位置
|
|
|
-//// if (i == endPage && j == endNum) {
|
|
|
-//// break;
|
|
|
-//// }
|
|
|
-// //若当前遍历到的专利号是需要删除的专利,则跳过,不下载它
|
|
|
-//// if (isDeletePatentNos != null && isDeletePatentNos.size() > 0 && isDeletePatentNos.contains(starPatents.get(j).getApplicationNo())) {
|
|
|
-//// continue;
|
|
|
-//// }
|
|
|
-//
|
|
|
-// //将专利丢入各生产线程,进行生产和消费
|
|
|
-// UploadParamsVO uploadParamsVO = new UploadParamsVO();
|
|
|
-// uploadParamsVO.setPatent(new Patent());
|
|
|
-// uploadParamsVO.getPatent().setPatentNo(starPatents.get(j).getPatentNo());
|
|
|
-//
|
|
|
-// PQueueData pQueueData = new PQueueData()
|
|
|
-// .setTask(task)
|
|
|
-// .setStarPatent(starPatents.get(j))
|
|
|
-// .setUploadParamsVO(uploadParamsVO);
|
|
|
-//
|
|
|
-// //专利丢入著录生产者队列,并唤醒著录生产者线程
|
|
|
-// if (cells.contains("1")) {
|
|
|
-// pantentQueueService.zhuluToPQueue(pQueueData);
|
|
|
-// }
|
|
|
-// //专利丢入权要生产者队列,并唤醒权要生产者线程
|
|
|
-// if (cells.contains("2")) {
|
|
|
-// pantentQueueService.rightToPQueue(pQueueData);
|
|
|
-// }
|
|
|
-// //专利丢入说明书文本生产者队列,并唤醒说明书文本生产者线程
|
|
|
-// if (cells.contains("3")) {
|
|
|
-// pantentQueueService.instructionTextToPQueue(pQueueData);
|
|
|
-// }
|
|
|
-// //专利丢入说明书pdf生产者队列,并唤醒说明书pdf生产者线程
|
|
|
-// if (cells.contains("4")) {
|
|
|
-// pantentQueueService.instructionPDFToPQueue(pQueueData);
|
|
|
-// }
|
|
|
-// //专利丢入摘要附图生产者队列,并唤醒摘要附图生产者线程
|
|
|
-// if (cells.contains("6")) {
|
|
|
-// pantentQueueService.imageToPQueue(pQueueData);
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// }
|
|
|
+ //根据计算出的起止页数,一页一页检索
|
|
|
+ for (int i = startPage; i <= endPage; i++) {
|
|
|
+ PatentStarListDTO patentStarListDto = new PatentStarListDTO()
|
|
|
+ .setCurrentQuery(conditions)
|
|
|
+ .setOrderBy(orderBy)
|
|
|
+ .setOrderByType(orderByType)
|
|
|
+ .setPageNum(i)
|
|
|
+ .setRowCount(50)
|
|
|
+ .setDBType(dbType);
|
|
|
+ //调用一般接口返回一批专利著录相关数据
|
|
|
+ Map<String, Object> resultMap = patentStarApiService.patentStarSearchApi(patentStarListDto);
|
|
|
+ if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
|
+ ThrowException.throwXiaoShiException("未检索到相关专利");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<StarPatentVO> starPatents = (List<StarPatentVO>) resultMap.get("records");
|
|
|
+ //遍历这一页的专利
|
|
|
+ for (int j = 0; j < starPatents.size(); j++) {
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|