|
@@ -320,7 +320,7 @@ public class PatentExportService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public Integer updateTaskStateToDoing(Integer taskId,Long total) {
|
|
|
+ public Integer updateTaskStateToDoing(Integer taskId, Long total) {
|
|
|
ImportTask importTask = importTaskService.getById(taskId);
|
|
|
if (importTask == null) {
|
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导入任务不存在");
|
|
@@ -392,7 +392,7 @@ public class PatentExportService {
|
|
|
|
|
|
EsCustomFieldBatchVO esVO = exportTask.getEsVO();
|
|
|
List<PatentExportVO> selectedFields = esVO.getSelected();
|
|
|
- selectedFields=selectedFields.stream().filter(PatentExportVO::getSelected).collect(Collectors.toList());
|
|
|
+ selectedFields = selectedFields.stream().filter(PatentExportVO::getSelected).collect(Collectors.toList());
|
|
|
Integer taskId = exportTask.getTaskId();
|
|
|
Integer projectId = exportTask.getProjectId();
|
|
|
String createId = exportTask.getCreateId();
|
|
@@ -433,16 +433,16 @@ public class PatentExportService {
|
|
|
Long startNum = null;
|
|
|
Long endNum = null;
|
|
|
if (esVO.getStartNumber() != null) {
|
|
|
- startNum =0l+esVO.getStartNumber();
|
|
|
+ startNum = 0l + esVO.getStartNumber();
|
|
|
}
|
|
|
if (esVO.getEndNumber() != null) {
|
|
|
- endNum = 0l+esVO.getEndNumber();
|
|
|
+ endNum = 0l + esVO.getEndNumber();
|
|
|
}
|
|
|
|
|
|
if (startNum == null) {
|
|
|
startNum = 1l;
|
|
|
}
|
|
|
- Long toNum = startNum+9l;
|
|
|
+ Long toNum = startNum + 9l;
|
|
|
if (endNum != null && endNum < toNum) {
|
|
|
toNum = endNum;
|
|
|
}
|
|
@@ -470,7 +470,7 @@ public class PatentExportService {
|
|
|
firstRecords.getTotal();
|
|
|
}
|
|
|
|
|
|
- this.updateTaskStateToDoing(taskId,total);
|
|
|
+ this.updateTaskStateToDoing(taskId, total);
|
|
|
List<PatentColumnDTO> firstPatentList = (List<PatentColumnDTO>) firstRecords.getData();
|
|
|
List<String> firstPatentNos = firstPatentList.stream().map(PatentColumnDTO::getPatentNo).collect(Collectors.toList());
|
|
|
|
|
@@ -532,7 +532,7 @@ public class PatentExportService {
|
|
|
esQueryPatentFieldsDTO.setPatentNos(inNos);
|
|
|
List<EsPatentFieldsVO> esPatentFieldsVOS = esCustomFieldService.getPatentFields(esQueryPatentFieldsDTO);
|
|
|
// List<Patent> patentList = esPatentService.getPatentsByNo(inNos, true, null, null);
|
|
|
- List<PatentColumnDTO> patentList = esPatentService.getPatentsByNo1(inNos, true, null, null,projectId);
|
|
|
+ List<PatentColumnDTO> patentList = esPatentService.getPatentsByNo1(inNos, true, null, null, projectId);
|
|
|
for (int i = 0; i < patentList.size(); i++) {
|
|
|
|
|
|
PatentColumnDTO patent = patentList.get(i);
|
|
@@ -566,13 +566,11 @@ public class PatentExportService {
|
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导出记录失败");
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
-
|
|
|
- catch (FileNotFoundException e) {
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
e.printStackTrace();
|
|
|
throw new FileNotFoundException();
|
|
|
} catch (Exception e) {
|
|
|
-e.printStackTrace();
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -630,18 +628,21 @@ e.printStackTrace();
|
|
|
if (innerPatentFieldsVO != null) {
|
|
|
List<FieldValueVO> fieldValueVOS = innerPatentFieldsVO.getFieldValueVOS();
|
|
|
if (!fieldValueVOS.isEmpty()) {
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
+ List<String> sb = new ArrayList<>();
|
|
|
+
|
|
|
for (FieldValueVO fieldValueVO : fieldValueVOS) {
|
|
|
String valueStr = fieldValueVO.getValue();
|
|
|
- sb.append(valueStr);
|
|
|
+ sb.add(valueStr);
|
|
|
}
|
|
|
HSSFCell cell = row.createCell(j);
|
|
|
ExcelUtils.setExcelCellStyle(commonCellStyle);
|
|
|
commonCellStyle.setVerticalAlignment(VerticalAlignment.TOP);
|
|
|
commonCellStyle.setWrapText(true);
|
|
|
cell.setCellStyle(commonCellStyle);
|
|
|
- cell.setCellValue(sb.toString());
|
|
|
-
|
|
|
+ if (sb.size() > 0) {
|
|
|
+ String trueSb = StringUtils.join(sb, "\n");
|
|
|
+ cell.setCellValue(trueSb);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|