|
@@ -357,6 +357,7 @@ public class PatentExportService {
|
|
|
|
|
|
EsCustomFieldBatchVO esVO = exportTask.getEsVO();
|
|
EsCustomFieldBatchVO esVO = exportTask.getEsVO();
|
|
List<PatentExportVO> selectedFields = esVO.getSelected();
|
|
List<PatentExportVO> selectedFields = esVO.getSelected();
|
|
|
|
+ selectedFields=selectedFields.stream().filter(PatentExportVO::getSelected).collect(Collectors.toList());
|
|
Integer taskId = exportTask.getTaskId();
|
|
Integer taskId = exportTask.getTaskId();
|
|
Integer projectId = exportTask.getProjectId();
|
|
Integer projectId = exportTask.getProjectId();
|
|
String createId = exportTask.getCreateId();
|
|
String createId = exportTask.getCreateId();
|
|
@@ -384,7 +385,7 @@ public class PatentExportService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
HSSFWorkbook hssfWorkbook = this.getExportHssWorkbook(headers);
|
|
HSSFWorkbook hssfWorkbook = this.getExportHssWorkbook(headers);
|
|
- HSSFSheet hssfSheet = hssfWorkbook.createSheet();
|
|
|
|
|
|
+ HSSFSheet hssfSheet = hssfWorkbook.getSheetAt(0);
|
|
StringRequest queryRequest = new StringRequest();
|
|
StringRequest queryRequest = new StringRequest();
|
|
BeanUtils.copyProperties(esVO, queryRequest);
|
|
BeanUtils.copyProperties(esVO, queryRequest);
|
|
|
|
|
|
@@ -410,7 +411,7 @@ public class PatentExportService {
|
|
if (endNum != null && endNum < toNum) {
|
|
if (endNum != null && endNum < toNum) {
|
|
toNum = endNum;
|
|
toNum = endNum;
|
|
}
|
|
}
|
|
- Integer index = 1;
|
|
|
|
|
|
+ Integer index = 0;
|
|
String json = CommonService.readJsonFile("patent.json");
|
|
String json = CommonService.readJsonFile("patent.json");
|
|
List<PatentConfigVO> patentConfigVOS = JSON.parseArray(json, PatentConfigVO.class);
|
|
List<PatentConfigVO> patentConfigVOS = JSON.parseArray(json, PatentConfigVO.class);
|
|
|
|
|
|
@@ -437,7 +438,7 @@ public class PatentExportService {
|
|
this.updateTaskStateToDoing(taskId,total);
|
|
this.updateTaskStateToDoing(taskId,total);
|
|
List<Patent> firstPatentList = (List<Patent>) firstRecords.getData();
|
|
List<Patent> firstPatentList = (List<Patent>) firstRecords.getData();
|
|
List<String> firstPatentNos = firstPatentList.stream().map(Patent::getPatentNo).collect(Collectors.toList());
|
|
List<String> firstPatentNos = firstPatentList.stream().map(Patent::getPatentNo).collect(Collectors.toList());
|
|
- ;
|
|
|
|
|
|
+
|
|
//查询自定义字段
|
|
//查询自定义字段
|
|
esQueryPatentFieldsDTO.setPatentNos(firstPatentNos);
|
|
esQueryPatentFieldsDTO.setPatentNos(firstPatentNos);
|
|
List<EsPatentFieldsVO> firstEsPatentFieldsVOS = esCustomFieldService.getPatentFields(esQueryPatentFieldsDTO);
|
|
List<EsPatentFieldsVO> firstEsPatentFieldsVOS = esCustomFieldService.getPatentFields(esQueryPatentFieldsDTO);
|
|
@@ -450,7 +451,9 @@ public class PatentExportService {
|
|
|
|
|
|
index++;
|
|
index++;
|
|
importTaskAMVO.setDoneNum(index);
|
|
importTaskAMVO.setDoneNum(index);
|
|
|
|
+
|
|
this.sendWebSocketMessage(projectId, taskId, createId, total.intValue(), index, false);
|
|
this.sendWebSocketMessage(projectId, taskId, createId, total.intValue(), index, false);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -466,7 +469,7 @@ public class PatentExportService {
|
|
}
|
|
}
|
|
|
|
|
|
esPatentCommonVO.setStartNum(startNum);
|
|
esPatentCommonVO.setStartNum(startNum);
|
|
- esPatentCommonVO.setEndNum(endNum);
|
|
|
|
|
|
+ esPatentCommonVO.setEndNum(toNum);
|
|
Records records = this.queryPatents(esPatentCommonVO);
|
|
Records records = this.queryPatents(esPatentCommonVO);
|
|
|
|
|
|
List<Patent> patentList = (List<Patent>) records.getData();
|
|
List<Patent> patentList = (List<Patent>) records.getData();
|
|
@@ -491,6 +494,7 @@ public class PatentExportService {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
esQueryPatentFieldsDTO.setPatentNos(inNos);
|
|
esQueryPatentFieldsDTO.setPatentNos(inNos);
|
|
List<EsPatentFieldsVO> esPatentFieldsVOS = esCustomFieldService.getPatentFields(esQueryPatentFieldsDTO);
|
|
List<EsPatentFieldsVO> esPatentFieldsVOS = esCustomFieldService.getPatentFields(esQueryPatentFieldsDTO);
|
|
List<Patent> patentList = esPatentService.getPatentsByNo(inNos, true, null, null);
|
|
List<Patent> patentList = esPatentService.getPatentsByNo(inNos, true, null, null);
|
|
@@ -518,15 +522,17 @@ public class PatentExportService {
|
|
fileGuid = parseByteToFileUtils.uploadFile(out.toByteArray(), 1);
|
|
fileGuid = parseByteToFileUtils.uploadFile(out.toByteArray(), 1);
|
|
}
|
|
}
|
|
exportTask.setFileGuid(fileGuid);
|
|
exportTask.setFileGuid(fileGuid);
|
|
|
|
+ exportTask.setState(2);
|
|
Integer reTaskId = importTaskService.updateExportTask(exportTask);
|
|
Integer reTaskId = importTaskService.updateExportTask(exportTask);
|
|
if (reTaskId == null) {
|
|
if (reTaskId == null) {
|
|
throw new XiaoShiException("导出记录失败");
|
|
throw new XiaoShiException("导出记录失败");
|
|
}
|
|
}
|
|
|
|
|
|
} catch (FileNotFoundException e) {
|
|
} catch (FileNotFoundException e) {
|
|
|
|
+ e.printStackTrace();
|
|
throw new FileNotFoundException();
|
|
throw new FileNotFoundException();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
-
|
|
|
|
|
|
+e.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|